1. Checking Google Play Services
As indicated here , you should always ensure that:
- The Google Play Apps APK is present at all.
- The correct version is installed.
You basically do these checks in the onResume() method. GooglePlayServiceUtils has a method called isGooglePlayServicesAvailable(...) that checks if Google Play services are installed and that they are the correct version. It returns an int error code, which roughly says what is wrong:
@Override public void onResume() { super.onResume(); int errorCode = GooglePlayServicesUtil.isGooglePlayServicesAvailable(getActivity()); switch(errorCode) { case ConnectionResult.SUCCESS: // Google Play Services installed and up to date break; case ConnectionResult.SERVICE_MISSING: // Google Play services is missing on this device. break; case ConnectionResult.SERVICE_VERSION_UPDATE_REQUIRED: // The installed version of Google Play services is out of date. break; case ConnectionResult.SERVICE_DISABLED: // The installed version of Google Play services has been disabled on this device. break; case ConnectionResult.SERVICE_INVALID: // The version of the Google Play services installed on this device is not authentic. break; case ConnectionResult.DATE_INVALID: // The device date is likely set incorrectly. break; } }
You can use the showErrorDialogFragment(...) method for GooglePlayServiceUtils to display the corresponding error message:
int errorCode = GooglePlayServicesUtil.isGooglePlayServicesAvailable(getActivity()); if(GooglePlayServiceUtil.showErrorDialogFragment(errorCode, getActivity(), REQUEST_CODE)) { // Dialog was shown } else { // Dialog was not shown. }
The dialog is displayed only when the error code is different from ConnectionResult.SUCCESS .
You can find the documentation for the GooglePlayServiceUtil class here .
2. Refund
Regardless of whether you need a reserve, it depends only on your application and the market you are targeting. For example, if you publish it to the Google Play Store, which I believe has been doing since you use the Google Play Services, then you really don't need a backup. As users download your application, they first need the Google Play Store, and if they have the Google Play Store, they have access to Google Play services. This, of course, is a completely different story if you want to publish it on Amazon devices or in the Nokia Store, because devices that they don’t have have a Google Play Store or Google Play Services. Also in markets such as China, there are hardly any Android devices in the Google Play Store or in any Google services, so, in essence, you need to decide if this is necessary for your application, but, as I said, if you Post it on the Google Play Store, I wouldn’t worry about that. The checks, as well as the error dialog that I mentioned above, should be more than enough to make sure your application works well. The introduction of new versions of the APK of Google Play apps is pretty fast. This may take several days, but after that most devices received an update. You should also think about one thing: if you are developing an application to require the function of the current Google Play Services, than you are likely to not encounter any problems, since almost all devices already have the current version, it would be rather difficult to find the device, which is not updated. You just need to be careful when you quickly push an update to your application, which uses some of the new features that were introduced just a few days ago. In this case, you may have additional problems.
But in the end, you should remember that it all depends on the country in which you publish your application, and on the ecosystems for which you want to release your application.
Hope I can answer your question, and if you have any questions, feel free to ask!