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}
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();
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());
}
}
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?
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
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With