title: Checking for google play services
body: <p>It drives me crazy how important documentation is often overlooked in the google docs. I would have plucked out my hair if I wasn't bald already. </p>
  
  <pre><code>private void checkGooglePlayServices() {
    int errorCode = GoogleApiAvailability.getInstance().isGooglePlayServicesAvailable(this);
    boolean isErrorResolvable = GoogleApiAvailability.getInstance().isUserResolvableError(errorCode);
  
    if (isErrorResolvable) {
       GoogleApiAvailability.getInstance().getErrorDialog(this, errorCode, REQUEST_CODE_GOOGLE_PLAY_SERVICES).show();
    } else {
       if (errorCode == ConnectionResult.SUCCESS) {
          launchApplication();
       }
    }
  }
  </code></pre>
  
  <p>The above code displays a Dialog box which says has a button reading <strong><em>get google play services</em></strong>:</p>
  
  <pre><code>@Override
  protected void onActivityResult(int requestCode, int resultCode, Intent data) {
    super.onActivityResult(requestCode, resultCode, data);
    if (requestCode == REQUEST_CODE_GOOGLE_PLAY_SERVICES) {
  
    }
  }
  </code></pre>
  
  <p>now what should I do here ? How should I direct the user to the play store to get an update for the playservices? I deem
  <code>getErrorResolutionPendingIntent</code> to be of use here, but I am not sure how to go about this.</p>
  
  <p>please aid me.</p>