Last year, I released my game The Little Plane That Could, which included an Android version. For this Android version, I had integrated leader boards and achievements via Google Play Games C++ SDK (also known as gpg-cpp-sdk). I am revisiting this SDK, as I plan to use it in my other titles as well, most prominently, for The Little Crane That Could. I did not keep too many notes during that time, so now I have to reconstruct the steps I took, doing this. This blog post is a brain dump on that matter.
NDK users, it seems, need to gather quite a few pieces from various places. One such piece is a .jar file which involves copying the directory $(ANDROID_SDK_ROOT)/extras/google/google_play_services/libproject/google-play-services_lib to your project directory.
A second piece is gpg-cpp-sdk/ which requires downloading as a .zip file from Game Services SDK Download Page. These are static libraries that you need to reference with the LOCAL_STATIC_LIBRARIES macro as 'gpg-1' in your jni/Android.mk file.
In your AndroidManifest.xml file, inside the
<meta-data android:name="com.google.android.gms.version" android:value="@integer/google_play_services_version" />
<meta-data android:name="com.google.android.gms.games.APP_ID" android:value="@string/app_id" />
I based my client code on StateManager.h/cpp from a cross platform example..
On the developer portals, a lot of administration is required. This first major hurdle is that there are two different 'developer consoles' that are named similarly, but are very distinct. There is the Google Play Developer Console that manages the entire app. However, for the game services, there is another console named Google Developers Console. The latter is used to manage the use of APIs as there are: Google+ API, Google Play Game Services, Google Play Game Management, Google Cloud Pub/Sub, Drive API.
When linking your apps to the game service, you actually need to link your app twice, once for the release version, and once for the debug version. For this you need to extract SHA1 certificate fingerprints from both your release key, and your debug key. The commands to retrieve those keys are shown below. The default password on the debugkey is 'android'.
$ keytool -exportcert -alias androiddebugkey -keystore ~/.android/debug.keystore -list -v $ keytool -exportcert -keystore ~/.ssh/googleplay-release-key.keystore -list -v
I love it when I read my own stackoverflow solution to a problem I bump into a year later! You need to edit project.properties file.