0

first of all I'm a noob Android developer. I came from iOS background and everything I see about Android development is driving me a little crazy, so apologies if what I'm about to ask is a dumb question.

I succesfully implemented a "Sign in with Google+" login in my app and now I need some information from the logged user. Here you can see some data retrieved from him.

@Override
public void onConnected(Bundle bundle) {
    Log.d(TAG, "CONNECTED TO GOOGLE");

    String accountName = Plus.AccountApi.getAccountName(mGoogleApiClient);

    Log.d(TAG, "USER EMAIL: " + accountName);


    if (Plus.PeopleApi.getCurrentPerson(mGoogleApiClient) != null){
        Person user = Plus.PeopleApi.getCurrentPerson(mGoogleApiClient);
        Log.d(TAG, "USER NAME: "+ user.getName().getGivenName());
        Log.d(TAG, "USER IMAGE: " + user.getImage().getUrl());
        Log.d(TAG, "USER ID: " + user.getId());
    }
}

But I need two more things: User's access token and user's access secret.

I did something similar on an iOS app but I'm really lost trying to do it with Android. Anyone can help?

Thanks

WedgeSparda
  • 1,161
  • 1
  • 15
  • 40

1 Answers1

0

Follow this and this.Here it is described how you can get the access token of a google plus signed in user using a background thread.

Community
  • 1
  • 1
avinash pandey
  • 1,321
  • 2
  • 11
  • 15
  • Thanks, that helped me to get a token. But how can I get user's secret? On the Google+ API for iOS it was called "refreshToken". The token I already retrieved it was called "idToken" on the same iOS API. – WedgeSparda Apr 02 '15 at 16:01