LeaderboardService

The LeaderboardService provides a mechanism for multiple/all users to keep score, with leaderboard data abstracted out of any single app instance. Many leaderboard instances are possible in any app.
public class LeaderboardService

Methods

get

public void get(Integer page, Integer limit, String categories, Context CONTEXT, _CallbackFunction._Leaderboard cb)

The get method invokes a user provided callback method with a leaderboard as identified by "categories", starting on the specified page, for a maximum of limit entries.

Property

Type

Description

page

Integer

Starting page of leaderboard.

limit

Integer

Maximum number of entries to return in the leaderboard.

categories

String

Used to specify the leaderboard.

CONTEXT

Context

Android context for associating which part of the app invoked the call.

cb(Leaderboard leaderboard, String e)

CallbackFunction.Leaderboard

User provided callback that accepts a Leaderboard leaderboard and error String status.

update

public void update(Integer score, ArrayList<String> categories, Context CONTEXT, _CallbackFunction._Leaderboard cb)

information about the method

Property

Type

Description

score

Integer

User provided score to update on the leaderboard for "this" user

categories

ArrayList<String>

Leaderboards to update (can be more than one)

CONTEXT

Context

Android Context for associating which part of the app invoked the call.

cb(Leaderboard leaderboard, String e)

CallbackFunction.Leaderboard

user provided method that is invoked on completion of the update that receives a Leaderboard and String.