I use it like this, GoogleApiAvailability avail service available but user not signed in Profile is restricted by google so can not be used for play services private void checkPlayService(int PLAY_SERVICE_STATUS)Ĭase ConnectionResult.RESTRICTED_PROFILE: GooglePlayServicesUtil.isGooglePlayServicesAvailable() is deprecated and now GoogleApiAvailability.isGooglePlayServicesAvailable() should be used instead.įrom newer updates i have ended up with this code, i have made a handy method to manage all stuff related to it.Īll details related to availability of Service and related details are available here. It will ensure that the device is using the version your app requires, if not, then you can take action according to the documentation Edit SUCCESS, SERVICE_MISSING, SERVICE_VERSION_UPDATE_REQUIRED,
HOW TO CHECK A GAMES VERSION CODE
status code indicating whether there was an error.Ĭan be one of following in ConnectionResult:.Verifies that Google Play services is installed and enabled on this device,Īnd that the version installed on this device is no older than the one required So, when you set that in your manifest and then call isGooglePlayServicesAvailable(context): public static int isGooglePlayServicesAvailable (Context context) In order to be compatible with this client version. (declared in AndroidManifest.xml android:versionCode) Minimum Google Play services package version If you look in the link provided by Stan0 you will see this: public static final int GOOGLE_PLAY_SERVICES_VERSION_CODE