title: How can I get access token for server, if I use Games.API in Android?
body: <p>In my Android game I use Google Services for achievements and save game data. My Google Api Client:</p>
  
  <pre><code>mGoogleApiClient = new GoogleApiClient.Builder(this)
                  .addConnectionCallbacks(StartActivity.this)
                  .addOnConnectionFailedListener(StartActivity.this)
                  .addApi(Games.API).addScope(Games.SCOPE_GAMES)
                  .addApi(Drive.API).addScope(Drive.SCOPE_APPFOLDER)
                  .setViewForPopups(findViewById(android.R.id.content))
                  .build();
  </code></pre>
  
  <p>Now I need to use google authorization with my server. I read google documentation(<a href="https://developers.google.com/identity/sign-in/android/start" rel="nofollow">https://developers.google.com/identity/sign-in/android/start</a>) and try to realize this. I add <code>.addApi(Auth.GOOGLE_SIGN_IN_API, geo)</code>to my google api client. If I use this Api then I can get idToken for verification on server side. But I get an error "Auth.GOOGLE_SIGN_IN_API cannot be used with Games.API". Searching the Internet, I found that I should use only Games.API. How I found on Google developers blog (<a href="http://android-developers.blogspot.ru/2016/01/play-games-permissions-are-changing-in.html" rel="nofollow">http://android-developers.blogspot.ru/2016/01/play-games-permissions-are-changing-in.html</a>), this code is good:</p>
  
  <pre><code>GetServerAuthCodeResult result = Games.getGamesServerAuthCode(gac, clientId).await();  
  if (result.isSuccess()) {  
      String authCode = result.getCode();  
      // Send code to server.  
  }
  </code></pre>
  
  <p>But <code>GetServerAuthCodeResult</code> and <code>getGamesServerAuthCode</code> are deprecated. And <code>result.getCode()</code> always return <code>null</code> for me. What way is good to get token for server side authentication and also use Games.API for achievements?</p>