We use essential cookies for the website to function, as well as analytics cookies for analyzing and creating statistics of the website performance. To agree to the use of analytics cookies, click "Accept All". You can manage your preferences at any time by clicking "Cookie Settings" on the footer. More Information.

Only Essential Cookies
Accept All

com.huawei.hms.jos.games.achievement.Achievement

The Achievement class returns the specific achievement information. 

Public Method Summary

ReturnMethod
StringgetId()
Obtains the achievement ID.
intgetReachedSteps()
Obtains the number of steps that the player has gone toward unlocking the achievement.
StringgetDescInfo()
Obtains the description of an achievement.
StringgetLocaleReachedSteps()
Obtains the localized number of steps that the player has gone toward unlocking the achievement. For example, the Arabic number is returned for Arabic countries.
StringgetLocaleAllSteps()
Obtains the localized total number of steps required for unlocking the current achievement. For example, the Arabic number is returned for Arabic countries.
longgetRecentUpdateTime()
Obtains the timestamp when the achievement is updated the last time.
StringgetDisplayName()
Obtains the achievement name.
PlayergetGamePlayer()
Obtains information about the player related to the achievement.
UrigetVisualizedThumbnailUri()
Obtains the URI that can be used to load the revealed icon of the achievement.
intgetState()
Obtains the achievement status.
intgetAllSteps()
Obtains the total number of steps required for unlocking the achievement.
intgetType()
Obtains the achievement type.
UrigetReachedThumbnailUri()
Obtains the URI that can be used to download the achievement icon after the achievement is unlocked.

Public Methods

public String getId()

Obtains the ID of the current achievement, which uniquely identifies an achievement.

Return Values

typedescription
StringAchievement ID string.

public int getReachedSteps()

Obtains the number of steps that the player has gone toward unlocking the achievement.

Return Values

type
description
intNumber of steps that the player has gone toward unlocking the achievement.

public String getDescInfo()

Obtains the description of the current achievement. 

Return Values

typedescription
StringDescription of the current achievement.

public String getLocaleReachedSteps()

Obtains the localized number of steps that the player has gone toward unlocking the achievement. For example, the Arabic number is returned for Arabic countries.

Return Values

typedescription
StringNumber in the local language.

public String getLocaleAllSteps()

Obtains the localized total number of steps required for unlocking the current achievement. For example, the Arabic number is returned for Arabic countries.

Return Values

typedescription
StringNumber in the local language.

public long getRecentUpdateTime()

Obtains the timestamp when the achievement is updated the last time.

Return Values

typedescription
longTimestamp when the achievement is updated the last time, that is, number of milliseconds between the last achievement update time and 00:00:00 on January 1, 1970.

public String getDisplayName()

Obtains the current achievement name.

Return Values

typedescription
StringCurrent achievement name.

public Player getGamePlayer()

Obtains information about the currently signed-in player.

Return Values

typedescription
PlayerPlayer information returned in the Player object.

public Uri getVisualizedThumbnailUri()

Obtains the URI that can be used to download the achievement icon after the achievement is revealed but not unlocked.

Return Values

typedescription
UriURI that can be used to download the achievement icon.

public int getState()

Obtains the achievement status.

Return Values

typedescription
int● 1: displayed

● 2: hidden

● 3: unlocked

public int getAllSteps()

Obtains the total number of steps required for unlocking the achievement.

Return Values

typedescription
intTotal number of steps required for unlocking the achievement.

public int getType()

Obtains the achievement type.

Return Values

typedescription
int● 1: standard (No steps are set for this type of achievement.)
● 2: incremental (Steps are set for this type of achievement.)

public Uri getReachedThumbnailUri()

Obtains the URI that can be used to download the achievement icon after the achievement is unlocked.

Return Values

typedescription
UriURI that can be used to download the achievement icon.