谷歌,加上整合:无法加载可见圈 [英] Google plus integrating: Unable to load visible circles
问题描述
我想要得到的人的信息列表,谷歌加在我的应用程序:朋友的个人资料图片URL,可见名和ID
I want to get list of people info from google plus in my app: friends profile image URL, visible name and id.
下面的一个官方谷歌加积分教程。我做的测试程序通过这个教程,并被困在错误:
Here's an official google plus integrating tutorial. I make the test app by this tutorial and trapped on error:
Error requesting visible circles: Status{statusCode=NETWORK_ERROR, resolution=null}
实现谷歌API客户端:
Implementing the Google Api Client:
mGoogleApiClient = new GoogleApiClient.Builder(this)
.addConnectionCallbacks(this)
.addOnConnectionFailedListener(this)
.addApi(Plus.API, null)
.addScope(Plus.SCOPE_PLUS_PROFILE)
.addScope(Plus.SCOPE_PLUS_LOGIN)
.build();
下面是onResult:
Here's onResult:
@Override
public void onResult(People.LoadPeopleResult loadPeopleResult) {
if (loadPeopleResult.getStatus().getStatusCode() == CommonStatusCodes.SUCCESS) {
PersonBuffer personBuffer = loadPeopleResult.getPersonBuffer();
try {
int count = personBuffer.getCount();
for (int i = 0; i < count; i++) {
Log.d("TEST", "Display name: " + personBuffer.get(i).getDisplayName());
}
} finally {
personBuffer.close();
}
} else {
Log.e("TEST", "Error requesting visible circles: " + loadPeopleResult.getStatus());
}
}
和权限进入的AndroidManifest.xml:
And the permissions into AndroidManifest.xml:
<uses-permission android:name="android.permission.INTERNET" />
<uses-permission android:name="android.permission.GET_ACCOUNTS" />
<uses-permission android:name="android.permission.USE_CREDENTIALS" />
请帮我,我需要做什么?
Please help me, what I need to do?
推荐答案
我已经解决了!我的问题是:我没有正确地指定套餐:
像这样 com.example
,但正确的方法是 com.example.moduledir
I've fixed it! My problem was: I do not have specify package correctly:
like this com.example
but correct way is com.example.moduledir
这篇关于谷歌,加上整合:无法加载可见圈的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!