Sunday, January 25, 2015

Setting up Google Play Services


To develop an app using the Google Play Services APIs, one need to setup the projects with the Google Play services SDK. 

In order to add the Google Play services SDK package, below steps can be followed. 

Open SDK Manager, Open the Extras directory and select the Google Play Services and Google Repository. Google Play services are not available on every device, but available on all devices with Google Play Store.  An Android devices that run on 2.3 OS or later, Or Android emulator with an AVD that runs Google APIs platform based on Android 4.2.2 or higher will have the Google Play services available. 

Next Step is to add Play Services to The Project
1. Open the build.gradle file in the Application module directory 
2. Add a new build rule under dependancies for the version of play-services.

For e.g. 
apply plugin ‘com.android.application’

dependancies{
compile : ‘com.google.android.gms:play-services:6.5.87’
}

We need to be sure to update this version number everytime Google Play service is updated. 

3. Save the changes and Click Sync Project with Gradle files in the tool bar 
4. Open the app’s manifest file and add the following tag as child for application element 

android:value=“@integer/google_play_services_version”/>

Now one can begin developing with Google Play services! 


References:

No comments:

Post a Comment