I have learned that there are many ways to sign in app with Google Account. Here are two ways:
Use AccountManager.java
,
GOOD: can get user's email address and authToken.
BAD: can not get user's avatar and nickname.
Use Google+ Api
:
GOOD: can get user's all info , but email address.
BAD: no email address, and the view's style is not matching to my app.
QUESTION:
1 .How can i get avatar and nickname by using only AccountManager
?
Thanks for any help!
You can get the Email address via the Google+ API. You need to add the appropriate scopes and permission.
The scopes are
Scopes.PROFILE
Scopes.EMAIL
And you need the following permission
android.permission.GET_ACCOUNTS
Then you can retrieve the Email address with the AccountApi
Plus.AccountApi.getAccountName(googleApiClient)