Google has offered a bunch of services that developers can use in their Android apps. In this and following few blog posts, we demonstrate how easy it is to use them. Now, let’s get everything setup.
Download the SDK
You can find Google Play services in the Extras section from your Android SDK Manager. Simply install it. If you also want to support Froyo (Android 2.2), also install Google Play services for Froyo.
After installation, you can find it at */extras/google/google_play_services/*.
Configure Your Project
Update the build.gradle file of the corresponding module, adding the following section:
Then, update the AndroidManifest.xml file of the module, adding the following section:
Check If the Device Has Google Play Services
Considering the variety of Android devices out in the market, it’s possible that the device doesn’t have the latest version of Google Play services you required, the user disables it, or it can be simply missing from from the device. Therefore, it’s best practice to check its availability:
Tip: You should make your app usable and requires it only when needed, if Google Play services is not a must-have feature.
Yep, that’s it. Now you have Google Play services ready, have fun with it and keep reading ;)