title: Getting Access token from GooglePlus Sign in
body: <p>I'm currently writing a googleplus sign in app and I'm stuck at getting an access token from google. I've read google plus documentation on getting a access token <a href="https://developers.google.com/identity/sign-in/android/migration-guide#migrate_from_access_token_anti-pattern" rel="nofollow noreferrer">here</a>. And I'm not sure how to implement it. </p>
  
  <p>below shows part of my code which implements the gplus sign in: </p>
  
  <pre><code>public class GplusAction implements LoginInterface,LogoutInterface{
  
  private GoogleApiClient googleApiClient;
  private GoogleSignInOptions googleSignInOptions;
  private Context context;
  private final static int REQ_CODE = 777;
  private Intent signInIntent;
  private String accountname;
  
  public GplusAction(Context context) {
      this.context = context;
  
      googleSignInOptions = new GoogleSignInOptions.Builder(GoogleSignInOptions.DEFAULT_SIGN_IN)
              .requestEmail()
              .build();
  
      googleApiClient = new GoogleApiClient.Builder(context)
              .addApi(Auth.GOOGLE_SIGN_IN_API, googleSignInOptions)
              .build();
  }
  
  
  @Override
  public void login() {
      signInIntent = Auth.GoogleSignInApi.getSignInIntent(googleApiClient);
      startActivityForResult((Activity) context, signInIntent, REQ_CODE, null);
  }
  
  @Override
  public void logout() {
      Auth.GoogleSignInApi.signOut(googleApiClient);
  }
  
  
  @Override
  public void get_onActivityResult(int requestCode, int resultCode, Intent data) {
      if(requestCode == REQ_CODE){
          GoogleSignInResult result = Auth.GoogleSignInApi.getSignInResultFromIntent(signInIntent);
      }
  }
  </code></pre>
  
  <p>I have tried using GoogleAuthUtils but it seems to have deprecated as described in the link above. </p>
  
  <p>So here are my questions: 
    - How do I retrieve access token using the new method? </p>
  
  <p>Any ideas?</p>