Skip to content

Instantly share code, notes, and snippets.

View dekzitfz's full-sized avatar
🎯
Focusing

Adi Andrea dekzitfz

🎯
Focusing
View GitHub Profile
@dekzitfz
dekzitfz / checkGooglePlayServicesAvailable.java
Last active August 20, 2016 11:55
Android: Check whether Google Play Services are installed and current
private boolean checkPlayServices() {
GoogleApiAvailability apiAvailability = GoogleApiAvailability.getInstance();
int resultCode = apiAvailability.isGooglePlayServicesAvailable(this);
if (resultCode != ConnectionResult.SUCCESS) {
if (apiAvailability.isUserResolvableError(resultCode)) {
apiAvailability.getErrorDialog(this, resultCode, PLAY_SERVICES_RESOLUTION_REQUEST)
.show();
} else {
Log.i(TAG, "This device is not supported.");
finish();