Adding Google Play services to Android Studio
The first thing we need to know is what we need to add to our Android Studio. You just learned that the APK is available in the Google Play store and it is the actual runtime of the services. We, as developers, only need this package in our testing device while debugging our application. What we need to add to Android Studio is the Google Play services client library.
This library has to be declared as a dependency to your application, so perform the following steps:
Open the
build.gradle
file for your application module (/app/build.gradle
).Add a new dependency to the build of your app by typing the following line inside the
dependencies
block:dependencies { … compile 'com.google.android.gms:play-services:8.4.0' }
The latest Google Play Services version is 8.4 (December 2015). When new updates of the library are published, you will need to update the version number in the
build.gradle
file.Navigate to Tools | Android | Sync Project with Gradle...