this method keep returning 0. According to the developer docs this method should return something like SUCCES if the device got the newest version of google play. Does anybody know how to use this?
@Override
public void onResume() {
super.onResume();
GooglePlayServicesUtil.isGooglePlayServicesAvailable(getApplicationContext());
System.out.println("henkie: " + GooglePlayServicesUtil.isGooglePlayServicesAvailable(getApplicationContext()));
}
Clear Cache and Data This fix will also be useful when troubleshooting other apps. Open Settings on your Android phone. Tap on “Apps” and “Google Play Services” under the “All apps” section. Select “Storage,” then press the “Clear cache” button followed by the “Clear data” or “Clear storage” button.
If still you cannot update Google Play Services, clearing cache can solve your problem. We also stated about this in the beginning as the reason. If you don't know, cache holds the app's data temporarily so that it can remember the information when you next open the app. Many times, old cache files get corrupted.
When Google Play service finds any app to be outdated it might reflect this error on your Android device. So another potential solution you can try is to update all other apps on your device to get rid of the Google Play services unsupportable on your device error.
It is returning SUCCESS
. The documentation clearly states that the method had an int return type, and returns a
status code indicating whether there was an error. Can be one of following in ConnectionResult: SUCCESS, SERVICE_MISSING, SERVICE_VERSION_UPDATE_REQUIRED, SERVICE_DISABLED, SERVICE_INVALID.
To check against what was returned, use something like:
int status = GooglePlayServicesUtil.isGooglePlayServicesAvailable(getApplicationContext());
if(status == ConnectionResult.SUCCESS) {
//Success! Do what you want
}
Please read the documentation: 0
is SUCCESS
public static final int SUCCESS
The connection was successful.
Constant Value: 0 (0x00000000)
Documentation
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With