Skip to content

Instantly share code, notes, and snippets.

@muratcanbur
Created March 1, 2015 08:36
Show Gist options
  • Save muratcanbur/2a6a2b150893454e7be5 to your computer and use it in GitHub Desktop.
Save muratcanbur/2a6a2b150893454e7be5 to your computer and use it in GitHub Desktop.
method to verify google play services on the device
/**
* verify google play services on the device
* */
private boolean checkPlayServices() {
int resultCode = GooglePlayServicesUtil
.isGooglePlayServicesAvailable(this);
if (resultCode != ConnectionResult.SUCCESS) {
if (GooglePlayServicesUtil.isUserRecoverableError(resultCode)) {
GooglePlayServicesUtil.getErrorDialog(resultCode, this,
PLAY_SERVICES_RESOLUTION_REQUEST).show();
} else {
Toast.makeText(getApplicationContext(),
"This device is not supported.", Toast.LENGTH_LONG)
.show();
finish();
}
return false;
}
return true;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment