/**
* Check if Google Play services is available before making a request.
*
* @return true if Google Play services is available, otherwise false
*/
protected boolean googleServicesExist() {
// Check that Google Play services is available
int resultCode =
GooglePlayServicesUtil.isGooglePlayServicesAvailable(this);
// If Google Play services is available
if (ConnectionResult.SUCCESS == resultCode) {
return true;
// Google Play services was not available for some reason
} else {
return false;
}
}