In order for us to use the Google Play Service APIs, we need to set up our project with the Google Play Services SDK. If you have not already installed this, go to Android SDK Manager and get the Google Play Service SDK.
Now that our app uses Google Play services, to test the app, you must ensure that you run the app on either of the following:
We need to make Google Play services APIs available to our app.
Open the app's build.gradle
file and add the play-services
library under dependencies. The line to add the build.gradle
file should be similar to this:
compile 'com.google.android.gms:play-services:7.8.0'
Ensure that you change this to the latest version of play-services
and update it when a new version is released.
Save the file and click on Sync Project with...