How to get leaderboards using html.

Darragh McLernon

New member
Sep 2, 2014
3
0
0
Visit site
There's two ways of doing this on Android. The first and easiest way is to use the google play game services. Google will basically do all of the heavy lifting for you this way and there's a really great tutorial linked in the developer console in the play game services section. The only downside is that since google are running it, you'll have less control over how it's presented.

The other way is to set everything up yourself. For this you'll need your own website with server space and a backend database. In simplest terms you first set up the database with the fields and tables you want. Next you need to write some scripts (PHP or whatever server-side script you prefer) that accept a POST request that updates the database and responds with the updated database table. Finally, in Android you create a HTTPClient object that sends a POST request to the URL of your scripts and a HTTPResponse object to catch the response.

Personally I'd prefer the Google approach, but if you're just learning about web technologies the second option is a great starting point for understanding web interactions.
 

railkill

Member
Oct 25, 2014
10
0
0
Visit site
setting up yourself is way too much work, it's not just about HTTP POST requests, but you also must setup authentication tokens so that people can't just send requests from anywhere. Google Play Services uses OAuth 2.0 for this, and it makes sure everything is good to go, you should use it. it's the easiest way
 

KM-Games

Member
Aug 5, 2014
18
0
0
Visit site
I recommend you to google for "App42 Cloud Api" (i can not post links yet :/) I use it together with Unity, it`s really simple to setup, free for indie-studios (up to 1million api-calls) and the best is you can use it also for iOS and WP8 and PC Games.