Dismiss Notice

REGISTRATION IS AFTER ADMIN ACTIVATION

DONATIONS WITH PAYPAL CLICK TO BUTTON

3 MONTHS VIP - 10$; 6 MONTHS VIP - 20$; 1 YEAR VIP - 30$; 2 YEARS VIP - 50$; GOLD USER FOR LIFE VIP - 150$

DONATIONS WITH Bitcoin Address:3NRs3CK3fhXifrNYxHEZKpETDd9vNLMsMD

Dismiss Notice
The registration is approved by the Administrator. It takes about 1 day to approve your registration
Dismiss Notice
For open hidden message no need write thanks, thank etc. Enough is click to like button on right side of thread.

Leaderboards And Achievements With Google Play Game Services XE6-XE7

Discussion in 'Delphi Android And IOS' started by N0body, Oct 15, 2014.

  1. N0body
    Online

    N0bodyN0body is a Verified Member DelphiFan Administrator Staff Member DF Staff

    Developer Pham Dinh Hai from DeuxSoftware has published a wrapper for the Google Play Game Services API on Android for Delphi XE6 (and XE7) Firemonkey. The wrapper gives you access to the Leaderboard and Achievement services provided by Google. The developer originally built this code for his Delphi Firemonkey game which is called Rolling Sheep. You can see screenshots of the leaderboards and achievements on his game page. In any event he translated the JNI code by hand and is provided the full source for the Game Services wrapper for free. It has a helper JAR file called basegameutils.jar which then utilizes the google-play-services.jar. Now it does require that you modify the classes.dex file to get access to the Game Services. There is an included bat file and readme instructions which will help you compile your own classes.dex file for Delphi XE5 and Delphi XE6. In Delphi XE7 and Appmethod I think you can skip that step and add the JAR files directly to the Android Library section in your project. Here is a sample JNI class from the source code:


    Code:
    [JavaSignature('com/google/example/games/basegameutils/GameHelper')]
    JGameHelper = interface(JObject)
    ['{DC334E08-C537-4900-8333-4E882BCEA010}']
    {Methods}
    procedure setup(listener:JGameHelper_GameHelperListener);cdecl;
    procedure onStart(ac:JActivity);cdecl;
    procedure onStop();cdecl;
    function isSignedIn:boolean;cdecl;
    function getApiClient:JGoogleApiClient;
    procedure submitScore(LBid:JString;score:int64);cdecl;
    function GetLeaderboardIntent(LBid:JString):Jintent;
    function getAchievementsIntent():Jintent;
    procedure UnHIDE-THANKSAchievement(Aid:JString);cdecl;
    procedure loadScoreOfLeaderBoard(LBid:JString);cdecl;
    procedure enableDebugLog(enabled:boolean);cdecl;
    procedure onActivityResult(requestCode:integer; resultCode:integer; data:JIntent);cdecl;
    end;
    TJGameHelper = class(TJavaGenericImport<JGameHelperClass, JGameHelper>) end;
    


    Download HERE
     
  2. chrpaz
    Offline

    chrpaz Guest

    thanks
     
  3. zhuye999
    Offline

    zhuye999 DF Junior

    [font='Open Sans', Arial, Tahoma, Verdana, sans-serif]thanks[/font]
     

Share This Page

Laws
Our website, law, laws, copyright and aims to be respectful of individual rights. Our site, as defined in the law of 5651 serves as a provider of space. According to the law, contrary to the law of site management has no obligation to monitor content. Therefore, our site has adopted the principle of fit and remove. Works are subject to copyright laws and is shared in a manner that violated their legal rights, or professional associations, rights holders who, adsdelphi@gmail.com I can reach us at e-mail address. Complaints considered to be infringing on the examination of the content will be removed from our site.
Donate Help To Us and Be VIP
DONATIONS WITH PAYPAL CLICK TO BUTTON
6 MONTHS VIP - 20$; 1 YEAR VIP - 30$; 2 YEARS VIP - 50$; GOLD USER FOR LIFE VIP - 150$
Social Block