[Android Apps and Games] itspheres:
In this article I will describe how to set up Google Play Game Services has in eclipse

The article was written in the course of the game's development CLEAR SKY 2

[YOUTUBE]Heb0CMODHNg[/YOUTUBE]

Introduction

Many game developers want to use the service of Google Play Game Services in their games. I was no exception, but the knowledge and skills of how to quickly add support to your GPGS libgdx game was not. This article will describe how to connect the leaderboards and achievements. Initial data: Eclipse, set up the developer console to work with service game, android-project, the root project.

Setting

Will not tell you how to set up the developer console to work with GPGS, except to say that there we need the resources of the form:

games-ids.xml

<?xml version="1.0" encoding="utf-8"?>

<!--

Google Play game services IDs.

Save this file as res/values/games-ids.xml in your project.

-->

<resources>

<string name="app_id">310266082735</string>

<string name="achievement_take_10_levels">HgkIr62KmoQJEAIQBg</string>

<string name="achievement_take_30_levels">HgkIr62KmoQJEAIQBw</string>

<string name="achievement_take_50_levels">HgkIr62KmoQJEAIQCA</string>

<string name="achievement_take_70_levels">HgkIr62KmoQJEAIQCg</string>

<string name="achievement_take_100_levels">HgkIr62KmoQJEAIQCQ</string>

<string name="achievement_beginner_cutter">HgkIr62KmoQJEAIQDw</string>

<string name="achievement_advanced_cutter">HgkIr62KmoQJEAIQEA</string>

<string name="achievement_master_cutter">HgkIr62KmoQJEAIQEQ</string>

<string name="achievement_lucky">HgkIr62KmoQJEAIQEg</string>

<string name="achievement_cheerful">HgkIr62KmoQJEAIQEw</string>

<string name="achievement_exceptional_joyous">HgkIr62KmoQJEAIQFA</string>

<string name="achievement_thrust">HgkIr62KmoQJEAIQFQ</string>

<string name="achievement_very_persistent">HgkIr62KmoQJEAIQFg</string>

<string name="achievement_the_most_resistant">HgkIr62KmoQJEAIQFw</string>

<string name="achievement_1_000_000">HgkIr62KmoQJEAIQGA</string>

<string name="achievement_2_000_000">HgkIr62KmoQJEAIQGQ</string>

<string name="achievement_3_000_000">HgkIr62KmoQJEAIQGg</string>

<string name="achievement_unlucky">HgkIr62KmoQJEAIQGw</string>

<string name="achievement_loyal">HgkIr62KmoQJEAIQHA</string>

<string name="achievement_fan">HgkIr62KmoQJEAIQHQ</string>

<string name="achievement_leader_of_mars">HgkIr62KmoQJEAIQHg</string>

<string name="achievement_leader_of_neptune">HgkIr62KmoQJEAIQHw</string>

<string name="achievement_unhurried">HgkIr62KmoQJEAIQIA</string>

<string name="achievement_final_push">HgkIr62KmoQJEAIQIQ</string>

<string name="leaderboard_leaderboard">HgkIr62KmoQJEAIQAQ</string>

<string name="leaderboard_pack_1">HgkIr62KmoQJEAIQCw</string>

<string name="leaderboard_pack_2">HgkIr62KmoQJEAIQDA</string>

</resources>

where app_id - your application ID, line and form leaderboard_xxx achievement_xxx point to a specific table records and achievement, respectively. It should create a resource xml-file with the name games-ids.xml in android-project of his game and put back up resources.

View attachment 2952984

To work GPGS need a project library google-play-services_lib. His path <android-sdk> \ extras \ google \ google_play_services \ libproject \ google-play-services_lib. By default, gaming services are not installed with the Android SDK, so this way there will be nothing. To fix this you need to install the Android SDK Manager two packages: Google Repository and Google Play services.

View attachment 2952985

The project library google-play-services_lib be imported into Eclipse. Then set the properties of the imported project tick «Is library».

View attachment 2952986

Now we need to link together your android-project and library google-play-services_lib. To do this, add the library to the section Required projects on the build path. (Properties -> Java Build Path -> Projects).

View attachment 2952987

At this stage, it was possible to finish the setting, but the official documentation Google strongly recommends the use of a class-mate GameHelper. Its installation is similar to installing google-play-services_lib (import a project as a library, associate the project library with android-project). Download BaseGameUtils.

In AndroidManifest.xml add two permissions and meta-data:

<uses-permission android:name="android.permission.INTERNET" />
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />

Meta-data is added inside the tag application:

<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" />

The setting is completed.

Google Play Clear Sky 2

Second part

XDA:DevDB Information

Clear Sky 2, App for all devices (see above for details)

Contributors

itspheres

Version Information

Status: Stable

Current Stable Version: r.1.02

Stable Release Date: 2014-09-27

Created 2014-09-28

Last Updated 2014-09-28