由网友(white° я)分享简介:我需要得到来自Google+的API,当前位置为Android。I need to get current location from Google+ API for Android.我在谷歌API控制台中所做的一切,并联系在一起SHA1和包名我与客户端ID的应用程序。I have done everything...
我需要得到来自Google+的API,当前位置为Android。
I need to get current location from Google+ API for Android.
我在谷歌API控制台中所做的一切,并联系在一起SHA1和包名我与客户端ID的应用程序。
I have done everything in Google API Console, and linked my app with client ID with SHA1 and package name.
我成功地获得有关用户名,个人资料图片,封面图片,电子邮件几乎资料...
I successfully get almost data about user name, profile picture, cover picture, email...
不过,我有问题的位置。我不能得到用户的位置。
But I have problem with location. I can't get user location.
我用这个范围:
mGoogleApiClient = new GoogleApiClient.Builder(this)
.addConnectionCallbacks(this)
.addOnConnectionFailedListener(this).addApi(Plus.API, null)
.addScope(Plus.SCOPE_PLUS_PROFILE).build();
我用这个code获得个人资料信息:
I use this code to get profile information:
String personName = currentPerson.getDisplayName();
String userId = currentPerson.getId();
String personPhotoUrl = currentPerson.getImage().getUrl();
String personGooglePlusProfile = currentPerson.getUrl();
String email = Plus.AccountApi.getAccountName(mGoogleApiClient);
String location = currentPerson.getCurrentLocation();
String coverPhoto = currentPerson.getCover().getCoverPhoto().getUrl();
和我成功地得到所有这些数据,但我得到空的位置。
And I sucessfully get all this data, but I get null as location.
有谁知道如何解决这个问题?
Does anyone know how to solve this problem?
推荐答案
看起来 currentLocation
值不的目前通过API 。
相关推荐
最新文章