Dismiss Notice

REGISTRATION IS AFTER ADMIN ACTIVATION

DONATIONS WITH PAYPAL CLICK TO BUTTON

1 MONTH VIP - 5$; 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.

Build A Cloud Based High Score System With Firemonkey

Discussion in 'Delphi Android And IOS' started by N0body, Mar 29, 2014.

  1. N0body
    Online

    N0bodyN0body is a Verified Member DelphiFan Administrator Staff Member DF Staff

    Sarina Dupont from Embarcadero has a tutorial up which shows how to build a cloud based high score system using Firemonkey. The article was written for Appmethod but should also work with Delphi XE5 (they both use the latest version of Firemonkey). On the server side Parse.com (which is a cloud based app hosting service) is used for storing the data. The TRESTClient component is used to make an SSL REST request to the server from your Android or IOS client and gets the scores in JSON format. The returned high score list is plugged into a FBMemTable and linked with LiveBindings to a TListView component. There is no example of posting high scores to the server but that is relatively simple. You just add your PlayerName and the Score as parameters of the TRESTRequest component and then use the ExecuteAsync function to send it to the server (I recommend ExecuteAsync vs. Execute). This tutorial is very similar to the previous tutorial for accessing the Beats Music API except in this tutorial you also control the server side of the REST request.

    As a bonus if you’d rather host your own high score server and not rely on a cloud provider like Parse there is a free high score module from NovelGames that has ASP.NET and a PHP server side code. The PHP version uses MySQL for high score storage. The high score system is built for Adobe Flash but it just uses HTTP so you can easily adapt it to work with TRESTClient. Download the free server side high score system code here.

    Code:
    // PHP sample from loadScores.php
    $siteID = $_POST['siteID'];
    $gameID = $_POST['gameID'];
    $gameName = $_POST['gameName'];
    $playerScore = $_POST['playerScore'];
    $playerCustomExtra = $_POST['playerCustomExtra'];
    
    $playerID = $_POST['playerID'];
    $playerName = $_POST['playerName'];
    $playerEmail = $_POST['playerEmail'];
    $playerUsername = $_POST['playerUsername'];
    $playerPassword = $_POST['playerPassword'];
    $playerPictureURL = $_POST['playerPictureURL'];
    $playerFacebookUserID = $_POST['playerFacebookUserID'];
    Demo Topic Here
     

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