We can add Google play service to your android application in easily with following steps.
- Create account and app in Google Play Developer Console
- Put BaseGameUtils folder to your app root
- Edit your project's Manifest, layout and Activity with some codes
Add following code.
<meta-data
android:name="com.google.android.gms.games.APP_ID"
android:value="@string/app_id" />
<meta-data
android:name="com.google.android.gms.version"
android:value="@integer/google_play_services_version" />
Add following to String.xml file in Layout folder...
<string name="app_id">YOUR APP ID</string>
<string name="number_guesses_leaderboard">YOUR LEADERBOARD ID</string>
add following to setting.gradle file
include ':BaseGameUtils'
add following to build.gradle file
dependencies {
compile 'com.google.android.gms:play-services:+'
compile project(':BaseGameUtils')
}
Now basic requirements are done. Check the the example code to how edit Activity.java file and layout.xml file for get service in Google Play Service.