Reputation: 419
I have done Google plus integration in android. in my application it login with google account.
it diplay below screen! Login screen
and after i login to my google account and i follow the steps 1) it ask application use your circle or only me then i select only me. 2) it signing in and display only my account name.I have used loadPerson method to get person detail...
@Override
public void onConnected(Bundle connectionHint)
{
mConnectionProgressDialog.dismiss();
String accountName = mPlusClient.getAccountName();
//mPlusClient.loadPeople(this, Person.Collection.VISIBLE);
Log.d("User", "Account Name = "+accountName);
Toast.makeText(GooglePlusActivity.this, "Welcome "+accountName, Toast.LENGTH_SHORT).show();
final String account = mPlusClient.getAccountName();
mPlusClient.loadPerson(this, "me");
}
onPersonload function...
@Override
public void onPersonLoaded(ConnectionResult status, Person person) {
// TODO Auto-generated method stub
if (status.getErrorCode() == ConnectionResult.SUCCESS) {
Log.d("GooglePlusActivity", "Display Name: " + person.getDisplayName());
Toast.makeText(this, "Display name:"+person.getDisplayName(), Toast.LENGTH_SHORT).show();
Toast.makeText(this, "about me:"+person.getAboutMe(), Toast.LENGTH_SHORT).show();
Toast.makeText(this, "id:"+person.getId(), Toast.LENGTH_SHORT).show();
Toast.makeText(this, "Name:"+person.getName(), Toast.LENGTH_SHORT).show();
Toast.makeText(this, "Birthdate:"+person.getBirthday(), Toast.LENGTH_SHORT).show();
Toast.makeText(this, "Gender:"+person.getGender(), Toast.LENGTH_SHORT).show();
}
else
{
Log.d("Error", "Connection error::"+status.getErrorCode());
}
}
then it display nothing when i select application use as Only me but it display detail when select "your circle"
is there any idea or sample code for getting detail. and how to fully sign out from account.so it should ask for new login....
Upvotes: 3
Views: 3425
Reputation: 3725
Okay I solved the problem and it isn't obvious. It is because the SHA1 ID is wrong. Since you are running the app from eclipse using Run or Debug mode you have a different SHA1 code. Go to the google api console and add the debug SHA1 code.
You get it by
Done. Tell me if that worked because it worked for me. Up vote if it did please.
Upvotes: 5