如何从Google+的API,当前位置为Android? [英] How to get current location from Google+ API for Android?

查看:143
本文介绍了如何从Google+的API,当前位置为Android?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我需要得到来自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

这篇关于如何从Google+的API,当前位置为Android?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆