title: how to connect to google play service and load leaderboard
body: <p>I want to connect my game with google play service. i have read documentation on android developer and try to following type-a-number sample and still can't load leaderboard.</p>
  
  <p>i have import baseGameUtils, but i use andengine so i didn't use extends BaseGameActivity from google.</p>
  
  <p>what i have until now:<br>
  - GooglePlayServicesUtil.isGooglePlayServicesAvailable(this) return success<br>
  - startActivityForResult(pickAccountIntent, REQUEST_CODE_PICK_ACCOUNT); is working well and i got my account name from onActivityResult(..);<br>
  -  i already put this on my manifest.  </p>
  
  <pre><code>&lt;meta-data android:name="com.google.android.gms.games.APP_ID"
          android:value="@string/app_id" /&gt;
  </code></pre>
  
  <p><strong>my questions are</strong><br>
  1. can i use google play service without extends BaseGameActivity?<br>
  2. if i use gameHelper.beginUserInitiatedSignIn(); after i got my account name, i got this on log cat. (what this connected mean? because i still got error on next question)</p>
  
  <pre><code>08-25 00:09:01.890: D/BaseGameActivity(11222): isGooglePlayServicesAvailable returned 0  
  08-25 00:09:01.890: D/BaseGameActivity(11222): beginUserInitiatedSignIn: starting new sign-in flow.  
  08-25 00:09:01.890: D/BaseGameActivity(11222): All clients now connected. Sign-in successful.  
  08-25 00:09:01.890: D/BaseGameActivity(11222): All requested clients connected. Sign-in succeeded!  
  </code></pre>
  
  <p>3 . how do i use connect()? i have read and tried about gameClient and GameClientBuilder but i have no idea how to use that. when i tried run this code.  </p>
  
  <pre><code>startActivityForResult(gameHelper.getGamesClient().getAllLeaderboardsIntent(), RC_UNUSED);  
  </code></pre>
  
  <p>i got this log.  </p>
  
  <pre><code>08-25 00:09:05.660: E/AndroidRuntime(11222): java.lang.IllegalStateException: Not connected. Call connect() and wait for onConnected() to be called.
  </code></pre>
  
  <p>4 . to use leaderboard i know i must use code from google play store such as CgkIx*<strong>**</strong>*AIQAA. but i didn't found where i must put this code to load leaderboard.</p>
  
  <p>sorry for long question, but i think if there is a sample that only for connect and either access achievement or leaderboard it will answer all my question. please don't tell me to see type-a-number sample, i did that and i need another sample code.  </p>
  
  <p><strong>update, my snipped code</strong>  </p>
  
  <pre><code>public class MainMenu extends Activity 
  implements OnClickListener, GooglePlayServicesClient.ConnectionCallbacks, GooglePlayServicesClient.OnConnectionFailedListener, GameHelperListener{
  
  @Override
  public void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    setContentView(R.layout.main_menu);
    gameHelper = new GameHelper(this);
  }
  
  @Override
  public void onClick(View v) {
    if(v.equals(loadData)) {
      if(gameHelper.isSignedIn()) {
        gameHelper.setup(this, GameHelper.CLIENT_GAMES, Scopes.GAMES);
        startActivityForResult(gameHelper.getGamesClient().getAllLeaderboardsIntent(), RC_UNUSED);
      }
    }
    else if(v.equals(loginButton)) {
      Intent googlePicker = AccountPicker.newChooseAccountIntent(null,null,new String[]{GoogleAuthUtil.GOOGLE_ACCOUNT_TYPE},true,null,null,null,null) ;
      startActivityForResult(googlePicker, REQUEST_CODE_PICK_ACCOUNT);
    }
  }
  
  @Override
  protected void onActivityResult(final int requestCode, final int resultCode, final Intent data) {
    if(requestCode==REQUEST_CODE_RECOVER_PLAY_SERVICES) {
      if (resultCode == RESULT_CANCELED) {
        Toast.makeText(this, "Google Play Services must be installed.", Toast.LENGTH_SHORT).show();
        finish();
      }
      return;
    }
    else if(requestCode==REQUEST_CODE_PICK_ACCOUNT) {
      if (resultCode == RESULT_OK) {
        String accountName = data.getStringExtra(AccountManager.KEY_ACCOUNT_NAME);
        gameHelper.beginUserInitiatedSignIn();
      }
      else if (resultCode == RESULT_CANCELED) {
        Toast.makeText(this, "This application requires a Google account.", Toast.LENGTH_SHORT).show();
        finish();
      }
      return;
    }
    super.onActivityResult(requestCode, resultCode, data);
  }
  
  // this 2 methods not called, is this also because my code is wrong?
  @Override
  public void onSignInFailed() {
    Log.d("rush", "on sign in failed");
  }
  
  @Override
  public void onSignInSucceeded() {
    Log.d("rush", "on sign in succeed");
  }
  
  }
  </code></pre>