I'm SuperMan
I'm SuperMan

Reputation: 743

Sigin my app with Google Account in Android

I have learned that there are many ways to sign in app with Google Account. Here are two ways:

  1. Use AccountManager.java , GOOD: can get user's email address and authToken. BAD: can not get user's avatar and nickname.

  2. 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 ?

  1. Is the Google+ Api's view be changed ? Any documents?

Thanks for any help!

Upvotes: 0

Views: 134

Answers (2)

Emanuel Seidinger
Emanuel Seidinger

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

Sinh Phan
Sinh Phan

Reputation: 1266

You can reference this guide from google doc. After signin, handle result then get user information.

Upvotes: 0

Related Questions