目录

The Ranking class returns leaderboard data. An instance of the Ranking type is returned when the getRankingSummary method of RankingsClient is called.

Constant Summary

typenamedescription

static final int

SCORE_VALUE_HIGH_BETTER

A larger score is better.

static final intSCORE_VALUE_SMALL_BETTERA smaller score is better.

Public Method Summary

Return

Method

String

getRankingDisplayName()

Obtains the display name of a leaderboard.

Uri

getRankingImageUri()

Obtains the URI of a leaderboard icon.

String

getRankingId()

Obtains the ID of a leaderboard.

int

getRankingScoreOrder()

Obtains the ordering mode of scores for a leaderboard.

ArrayList<RankingVariant>

getRankingVariants()

Obtains the rank of a player on the leaderboard by time frame (daily, weekly, and all-time). 

Constants

public static final int SCORE_VALUE_HIGH_BETTER

Ordering mode of scores. A larger score is better.

Constant value: 1

public static final int SCORE_VALUE_SMALL_BETTER

Ordering mode of scores. A smaller score is better.

Constant value: 0

Public Methods

public String getRankingDisplayName()

Obtains the display name of a leaderboard.

Return Values

Type

Description

String

Display name of a leaderboard.

public Uri getRankingImageUri()

Obtains the URI of a leaderboard icon.

Return Values

Type

Description

Uri

URI of a leaderboard icon.

public String getRankingId()

Obtains the ID of a leaderboard.

Return Values

Type

Description

String

Leaderboard ID allocated by AppGallery Connect when creating a leaderboard.

public int getRankingScoreOrder()

Obtains the ordering mode of scores for a leaderboard.

Return Values

Type

Description

int

Ordering mode of scores.

public ArrayList<RankingVariant> getRankingVariants()

Obtains the rank of a player on the leaderboard by time frame (daily, weekly, and all-time).

Return Values

Type

Description

ArrayList<RankingVariant>

RankingVariant object by time frame (daily, weekly, and all-time), including the scores of the current player in the three time frames.