Quick Links: Download Gideros Studio | Gideros Documentation | Gideros community chat | DONATE
Leaderboard/Highscore online feature with Android — Gideros Forum

Leaderboard/Highscore online feature with Android

marcmarc Member
edited February 2014 in General questions
Is there something I can add to a game to show a leaderboard with the help of Gideros? For Android?

I've read quite a lot about "gamekit" now, but "require 'gamekit'" errors that it's basically not there, and after looking into the "All Plugins" I think it can be compiled only for iOS. I'm planning to use Google's API, probably something like their sample line:

startActivityForResult(mGamesClient.getLeaderboardIntent(LEADERBOARD_ID), REQUEST_LEADERBOARD);

Is there some (equal) way?
Thanks for any help! :)

Comments

  • Hello @marc
    yes there are no GameCenter on Android, but there is a Google Play Service:

    https://github.com/ar2rsawseen/GiderosGooglePlay

    ;)
  • Hi, after reference to Google Play Services SDK my Admob won't work as describe below:
    http://stackoverflow.com/questions/19721158/utilize-both-play-services-and-admob-sdk

    Anywork around to use Google Play Services and Admob in Ads Interface? Or we must rewrite migration code:
    https://developers.google.com/mobile-ads-sdk/docs/admob/play-migration
  • Yes @thanhquan1512 unfortunately they have the same class names.
    I've already integrated new Admob version into Ads interface, I just did not finish adding some other stuff
    And also admob seems to misbehave when using in conjunction with Google Play services, been doing internal tests, but it seems in some situations there is nothing I can do and some errors happen inside Google Play service

    But any way I hope to release the new AdsInterface with upgraded SDKs etc next week
  • edited February 2014
    After a little research, I will implement Heyzap leaderboard and post the result tonight.
  • So, since Google placed Admob into the Play Services now, I could access Admob via the GiderosGooglePlay plugin, correct?

    There through an "AdsInterface", and this will be released soon? Or is the AdsInterface rather another plugin?

    Does it misbehave because of mixing the Java "gms" and the native "gms"?

    Anyway, so I better wait with adding Admob to my game, I guess. Orrrr I add both Admob and the leaderboard via Java only. From the Play Services I need only submitScore and showLeaderboard, getting the Java side calling that after the lua side calls something, that should be no problem, should it? (I mean, for me, trying to add features without plugins.)
  • AdsInterface unfortunately is the other plugin, but in Admob's case it will reuse the same Google Play service lib.

    There seems to be internal conflicts between using interstitials and services native dialogs, as it seems they kind of try to reuse same Activity for both? I really don't know yet, just doing more testing and researching
  • Thanks for the testing.. :)

    I've unfortunatly also another problem, which is that "gooleplay" doesn't work on my tablet (Asus Memo Pad HD 7 with Android 4.2.2), even without trying to add any Admob feature.

    It's like this: When I run the app without require('googleplay') then it works fine, but as soon as this line is added, the app stops immediately after starting with this line in the logcat:

    02-10 06:18:20.257: E/AndroidRuntime(5557): at com.giderosmobile.android.GiderosRenderer.onDrawFrame(somegameActivity.java:275)
    02-10 06:18:20.270: W/ActivityManager(439): Force finishing activity com.somevendor.somegame/com.giderosmobile.android.somegameActivity
    02-10 06:18:20.301: D/AES(439): process : com.somevendor.somegame
    02-10 06:18:20.301: D/AES(439): module : com.somevendor.somegame v10 (1.2)
    02-10 06:18:20.301: D/AEE/LIBAEE(439): shell: raise_exp(2, 5557, -1361051648, com.somevendor.somegame, 0x0x5a6ab360, 0x0x0)

    I think I've done all install instructions, the .so files are in the libs folders, System loads the library, the AppID is in the ids.xml and the other three lines are added, and my app has permission for Internet and for viewing Wifi connections.
  • @marc hmm, interesting, do you have anything else printed in logcat?
    raised shell exception could be lots of things
  • Oh, I've copied only this part :(, it was the only red line, and everything else was just the android task manager and stuff like that, it didn't say anything more about the exception. I'm now trying some things without the plugin, so I unfortunatly can't reproduce it atm.
  • @marc no worries ;)
    I will be rechecking its compatibility again with AdsInterface so will be checking the Google Play Service also

    And if you will still have problems, feel free to email me Android project that does not work for you to ar2rsawseen at gmail com so I could recheck what is wrong ;)
  • Hi,
    I have the same error that marc. It stops when reach the require.
    With the error in this line 197 of GGooglePlay.java sActivity.get().runOnUiThread(new Runnable() {

    I have follow the steps one by one.
    But the last I don't understand at all ◾Add external class: "com.giderosmobile.android.plugins.googleplaygame.GGooglePlay"
    Maybe the error occurs by this, because I make an import but It says unused.
  • ar2rsawseenar2rsawseen Maintainer
    @acuatoria in the Main Activity file there is an array inside onCreate method:
    static private String[] externalClasses = {
    }
    add the class string to it like this:
    static private String[] externalClasses = {
    		"com.giderosmobile.android.plugins.googleplaygame.GGooglePlay",
    	};
    And thats it ;)
  • Great, it works now!
    I have to import support v4 library, and correct the meta-data tag on manifest xml too.
    Thank you very much.
  • It will possible to implement with admob?
    Knowing the issue of the same class name
  • ar2rsawseenar2rsawseen Maintainer
    @acuatoria yes, just use AdsAdmob.java from AdsInterface and it will work with same linked Google Play services lib
  • Yes, works like a charm.
    I'm now with the achievements.
  • I'm unable to show the achievement in screen, maybe the command is deprecated.
    I'm using googleplay:showAchievements() --show achievements screen
    like says in doc
    Thank you in advance.
  • ar2rsawseenar2rsawseen Maintainer
    @acuatoria it should be right, what kind of error do you have?
  • I think the error was that the show achievements was inside
    googleplay:addEventListener(Event.REPORT_ACHIEVEMENT_COMPLETE, function()

    It's a nonsense but now it works. But not really how I want.
    There's a way to show the achievement image in a popup not in fullscreen?
    I have see that in other games.
  • ar2rsawseenar2rsawseen Maintainer
    How do you mean it in the popup? Like an unlocking notification?
  • Yes, something like this image http://i.stack.imgur.com/CHmUd.png
    a popup over the game.
  • ar2rsawseenar2rsawseen Maintainer
    edited May 2014
    @acuatoria this popup will appear automatically when the achievement is unlocked, when you are using update steps or unlocking achievement with immediate true
    and will display popup upon next syncing with immediate false

    There is no way to manually show it, it goes naturally with achievement unlocking process
Sign In or Register to comment.