use of com.google.android.gms.common.GoogleApiAvailability in project cw-omnibus by commonsguy.
the class AbstractMapActivity method readyToGo.
protected boolean readyToGo() {
GoogleApiAvailability checker = GoogleApiAvailability.getInstance();
int status = checker.isGooglePlayServicesAvailable(this);
if (status == ConnectionResult.SUCCESS) {
if (getVersionFromPackageManager(this) >= 2) {
return (true);
} else {
Toast.makeText(this, R.string.no_maps, Toast.LENGTH_LONG).show();
finish();
}
} else if (checker.isUserResolvableError(status)) {
ErrorDialogFragment.newInstance(status).show(getFragmentManager(), TAG_ERROR_DIALOG_FRAGMENT);
} else {
Toast.makeText(this, R.string.no_maps, Toast.LENGTH_LONG).show();
finish();
}
return (false);
}
use of com.google.android.gms.common.GoogleApiAvailability in project cw-omnibus by commonsguy.
the class AbstractMapActivity method readyToGo.
protected boolean readyToGo() {
GoogleApiAvailability checker = GoogleApiAvailability.getInstance();
int status = checker.isGooglePlayServicesAvailable(this);
if (status == ConnectionResult.SUCCESS) {
if (getVersionFromPackageManager(this) >= 2) {
return (true);
} else {
Toast.makeText(this, R.string.no_maps, Toast.LENGTH_LONG).show();
finish();
}
} else if (checker.isUserResolvableError(status)) {
ErrorDialogFragment.newInstance(status).show(getFragmentManager(), TAG_ERROR_DIALOG_FRAGMENT);
} else {
Toast.makeText(this, R.string.no_maps, Toast.LENGTH_LONG).show();
finish();
}
return (false);
}
use of com.google.android.gms.common.GoogleApiAvailability in project iosched by google.
the class MessagingRegistrationWithGCM method checkPlayServices.
/**
* Check the device to make sure it has the Google Play Services APK. If it doesn't, display a
* dialog that allows users to download the APK from the Google Play Store or enable it in the
* device's system settings.
*/
private boolean checkPlayServices() {
GoogleApiAvailability apiAvailability = GoogleApiAvailability.getInstance();
int resultCode = apiAvailability.isGooglePlayServicesAvailable(mActivity);
if (resultCode != ConnectionResult.SUCCESS) {
if (apiAvailability.isUserResolvableError(resultCode)) {
apiAvailability.getErrorDialog(mActivity, resultCode, PLAY_SERVICES_RESOLUTION_REQUEST).show();
} else {
LOGI(TAG, "Google Play Services is not available on this device.");
}
return false;
}
return true;
}
use of com.google.android.gms.common.GoogleApiAvailability in project robolectric by robolectric.
the class ShadowGoogleApiAvailabilityTest method getInstance.
@Test
public void getInstance() {
//Given the expected GoogleApiAvailability instance
final GoogleApiAvailability expected = GoogleApiAvailability.getInstance();
//When getting the actual one from the shadow
final GoogleApiAvailability actual = ShadowGoogleApiAvailability.getInstance();
//Then verify that the expected is a not null and equal to the actual one
assertThat(expected).isNotNull().isEqualTo(actual);
}
use of com.google.android.gms.common.GoogleApiAvailability in project cw-omnibus by commonsguy.
the class AbstractMapActivity method readyToGo.
protected boolean readyToGo() {
GoogleApiAvailability checker = GoogleApiAvailability.getInstance();
int status = checker.isGooglePlayServicesAvailable(this);
if (status == ConnectionResult.SUCCESS) {
if (getVersionFromPackageManager(this) >= 2) {
return (true);
} else {
Toast.makeText(this, R.string.no_maps, Toast.LENGTH_LONG).show();
finish();
}
} else if (checker.isUserResolvableError(status)) {
ErrorDialogFragment.newInstance(status).show(getFragmentManager(), TAG_ERROR_DIALOG_FRAGMENT);
} else {
Toast.makeText(this, R.string.no_maps, Toast.LENGTH_LONG).show();
finish();
}
return (false);
}
Aggregations