Google Play Services

Hi, there is a tutorial/wrapper to use google play services for use Leaderboards and Achievements on android? :slight_smile:
Thanks!

I am wrapping them with JNI, via a helper class I keep in the Cocos2dxActivity.

Using 2.2 — haven’t released it yet so not sure how stable it is. Can be done.

I don’t know of any tutorials tho.

Hey! That sounds very interesting! Maybe can create a GitHub and build a wrapper with some contributors. I will be in!

Is there possibility that GameCenter and Google Play can be wrapped into the same interfaces? haha

Yep, I use 2.2 :slight_smile:
Could you share you code? :stuck_out_tongue:

Thank!

Cory Trese wrote:

I am wrapping them with JNI, via a helper class I keep in the Cocos2dxActivity.
>
Using 2.2 — haven’t released it yet so not sure how stable it is. Can be done.
>
I don’t know of any tutorials tho.

Godspeed Charlie wrote:

Is there possibility that GameCenter and Google Play can be wrapped into the same interfaces? haha

Yes, it is in fact possible. Throw in Amazon too and you’ll find a complex, but workable JNI bridge can be built.

Maybe some parts of avalon could be interesting for you? :slight_smile:

Thanks for those urls, I will give them a try ^^

Michael Contento wrote:

Maybe some parts of avalon could be interesting for you? :slight_smile:
>
* Interface: https://github.com/hovergames/avalon/blob/master/avalon/GameCenter.h
* Amazon CPP: https://github.com/hovergames/avalon/blob/master/avalon/platform/android-amazon/gamecenter/GameCenter.cpp
* Amazon JAVA: https://github.com/hovergames/avalon/tree/master/avalon/platform/android-amazon/_java/gamecenter
* Google CPP: https://github.com/hovergames/avalon/blob/master/avalon/platform/android-google/gamecenter/GameCenter.cpp
* Google JAVA: https://github.com/hovergames/avalon/tree/master/avalon/platform/android-google/_java/gamecenter
* Apple: https://github.com/hovergames/avalon/tree/master/avalon/platform/ios/gamecenter

Thanks

Michael Contento wrote:

Maybe some parts of avalon could be interesting for you? :slight_smile:
>
* Interface: https://github.com/hovergames/avalon/blob/master/avalon/GameCenter.h
* Amazon CPP: https://github.com/hovergames/avalon/blob/master/avalon/platform/android-amazon/gamecenter/GameCenter.cpp
* Amazon JAVA: https://github.com/hovergames/avalon/tree/master/avalon/platform/android-amazon/_java/gamecenter
* Google CPP: https://github.com/hovergames/avalon/blob/master/avalon/platform/android-google/gamecenter/GameCenter.cpp
* Google JAVA: https://github.com/hovergames/avalon/tree/master/avalon/platform/android-google/_java/gamecenter
* Apple: https://github.com/hovergames/avalon/tree/master/avalon/platform/ios/gamecenter

Hi Michael, I tried integrate your code, but I have a problem with the compilation:
[javac] Compiling 4 source files to /Users/smartmind/Works/Smallthing/Easy Spider/Easy Spider/proj.android/BaseGameUtils/bin/classes
[javac] /Users/smartmind/Works/Smallthing/Easy Spider/Easy Spider/proj.android/BaseGameUtils/src/com/google/example/games/basegameutils/BaseGameActivity.java:23: error: package com.google.android.gms.appstate does not exist
[javac] import com.google.android.gms.appstate.AppStateClient;

and more more more erros…

in my project.properties I wrote:
android.library.reference.3=./BaseGameUtils/ <- this is in the root project
android.library.reference.4=…/…/…/…/SDK/Android/sdk/extras/google/google_play_services/libproject/google-play-services_lib
manifestmerger.enabled=true

Where I wrong?

Thanks!

ok, now I have compile every thing, but (:frowning: ) when ant generate dex I have a error:

[dx]
[dx] UNEXPECTED TOP-LEVEL EXCEPTION:
[dx] com.android.dx.util.DexException: Multiple dex files define Lcom/google/ads/AdRequest$ErrorCode;
[dx] at com.android.dx.merge.DexMerger.readSortableTypes(DexMerger.java:592)
[dx] at com.android.dx.merge.DexMerger.getSortedTypes(DexMerger.java:550)
[dx] at com.android.dx.merge.DexMerger.mergeClassDefs(DexMerger.java:531)
[dx] at com.android.dx.merge.DexMerger.mergeDexBuffers(DexMerger.java:168)
[dx] at com.android.dx.merge.DexMerger.merge(DexMerger.java:186)
[dx] at com.android.dx.command.dexer.Main.mergeLibraryDexBuffers(Main.java:300)
[dx] at com.android.dx.command.dexer.Main.run(Main.java:232)
[dx] at com.android.dx.command.dexer.Main.main(Main.java:174)
[dx] at com.android.dx.command.Main.main(Main.java:91)
[dx]

I don’t use Eclipse! I think is it a comflict with GoogleAdMobAdsSdk-6.4.1 and android-support-v4.jar… there is a solution?

Thanks!

@MichaelContento Hi, I integrated google play servces, but on logcat I have this error:

02-24 13:08:58.386: E/GooglePlayServicesUtil(26368): The Google Play services resources were not found. Check your project configuration to ensure that the resources are included.

do you have any idea?

Thanks!!

How you sloved the issues yet @ lordubik? I am having similar errors