Following Google Sign Button, I implemented it on my android device.
When clicking the button it shows you a popup asking your permission:
Know Who you are on Google.
Now what?
It looks like this gives me nothing. It does not provide me access_token, or any user data.
What is it good for?
*Please do not tell me how to get access_token this is not what the question is about
解决方案
You have to implement ConnectionCallbacks. And in onConnected(), you can start to get user data you want from the google plus account. Here's my sample code for the function:
@Override
public void onConnected(Bundle connectionHint) {
// We've resolved any connection errors.
mConnectionProgressDialog.dismiss();
String accountName = mPlusClient.getAccountName();
Person p = mPlusClient.getCurrentPerson();
String displayName = p.getDisplayName();
google_text.setText(String.format("email:%s\ndisplay name:%s",accountName, displayName));
}
You can see more Person data in Google's link: Person