2

some chinese android devices comes without compatibility with google apis, for example, with google maps.

If you try to install an app that uses google maps in these device, the device will not allow you to install it, and these apps are not visibles on google play for this device.

Exists a way to check if the device its compatible with official google apis?

Thanks

NullPointerException
  • 36,107
  • 79
  • 222
  • 382

1 Answers1

4

Google Maps and some other of google apis is part of Google Play services.

You must check the device to know Play services apk installed and updated to a version that you used in your app.

private boolean checkGooglePlayServices() {
    int resultCode = GooglePlayServicesUtil.isGooglePlayServicesAvailable(this);
    switch (resultCode) {
    case ConnectionResult.SUCCESS:
        return true;
    case ConnectionResult.SERVICE_DISABLED:
    case ConnectionResult.SERVICE_INVALID:
    case ConnectionResult.SERVICE_MISSING:
    case ConnectionResult.SERVICE_VERSION_UPDATE_REQUIRED:
        return false;
    }
    return false;
}
Aryan Najafi
  • 2,496
  • 27
  • 29
  • google play services apk can't be installed on my vexia tablet, because the vexia tablet does not support google apis.... you can install official google maps app from google on the market, but the apps that uses mapviews will not work on this tablet... – NullPointerException Aug 31 '14 at 09:52
  • 1
    @AndroidUser99: This code does not require the Play Services APK. It requires the Play Services library project, which gets compiled into your app. It *checks* to see if the Play Services APK is installed. – CommonsWare Aug 31 '14 at 10:25
  • ok, but what happens if you dont use play services library? Is not possible to achieve my needs without that library? – NullPointerException Aug 31 '14 at 13:11