Search code examples
androidgoogle-play-servicesupdatesandroid-version

Find out if Google Play Services can't be updated


I have an app that is released and working great. Every now and then few users post me and say that the app requests them to update Google Play Services but Google Play doesn't show the update. This is because their device is no longer supported by the latest version of Google Play Services.

Is there any other way to determine if a device is supported by the version of Google Play Services which you are using, other than checking if the device runs Android 2.3 or higher? (2.3 or higher is quaranteed to have the latest version)


Solution

  • You can use PackageManager to get versionCode of Google Play Services installed on the device (if present):

    int versionCode = getPackageManager().
                         getPackageInfo("com.google.android.gms", 0).versionCode;
    

    and show Dialog to the user, but I'd personally do nothing about that. If the latest version of platform is 2.3 just set minSdk to 2.3 - that would eliminate users on older versions (which makes no difference as they would not be able to use your app anyway).

    EDIT

    If you care your pre 2.3 users then you can release separate app that is build against Google Play Services for Froyo.