Reputation: 743
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!
Upvotes: 0
Views: 134
Reputation: 1272
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)
Upvotes: 1
Reputation: 1266
You can reference this guide from google doc. After signin, handle result then get user information.
Upvotes: 0