AchievementEntity | Android Developers

Quicknav Quicknav
Links

- Google Play Developer Console
- Android Developers Blog
- About Android

Android Sites

- Android.com
- Android Developers
- Android Open Source Project

Language
close

- - About
  - Wear
  - TV
  - Auto
- - Get Started
  - Devices
  - Style
  - Patterns
  - Building Blocks
  - Downloads
  - Videos
- - Training
  - API Guides
  - Reference
  - Tools
  - Google Services
  - Samples
- - Google Play
  - Essentials
  - Get Users
  - Engage & Retain
  - Monetize
  - Analyze
  - Tools & Reference
  - Developer Stories

## Results

Loading...
Summary: Inherited Constants | Fields | Methods | Inherited Methods | [Expand All]
public final class

# AchievementEntity

extends Object
implements Achievement Parcelable

java.lang.Object
↳ | com.google.android.gms.games.achievement.AchievementEntity

## Class Overview

Data object representing a set of Achievement data. This is immutable, and therefore safe to cache or store. Note, however, that the data it represents may grow stale.

This class exists solely to support parceling these objects and should not be used directly.

## Summary

[Expand] Inherited Constants
From interface com.google.android.gms.games.achievement.Achievement
int | STATE_HIDDEN | Constant returned by `getState()` indicating a hidden achievement.
int | STATE_REVEALED | Constant returned by `getState()` indicating a revealed achievement.
int | STATE_UNLOCKED | Constant returned by `getState()` indicating an unlocked achievement.
int | TYPE_INCREMENTAL | Constant returned by `getType()` indicating an incremental achievement.
int | TYPE_STANDARD | Constant returned by `getType()` indicating a standard achievement.
From interface android.os.Parcelable
int | CONTENTS_FILE_DESCRIPTOR |
int | PARCELABLE_WRITE_RETURN_VALUE |

Fields
public static final AchievementEntityCreator | CREATOR |

Public Methods
int | describeContents()
boolean | equals(Object obj)
Achievement | freeze() Freeze a volatile representation into an immutable representation.
String | getAchievementId() Retrieves the ID of this achievement.
int | getCurrentSteps() Retrieves the number of steps this user has gone toward unlocking this achievement; only applicable for `TYPE_INCREMENTAL` achievement types.
String | getDescription() Retrieves the description for this achievement.
void | getDescription(CharArrayBuffer dataOut) Loads the achievement description into the given `CharArrayBuffer`.
void | getFormattedCurrentSteps(CharArrayBuffer dataOut) Retrieves the number of steps this user has gone toward unlocking this achievement (formatted for the user's locale) into the given `CharArrayBuffer`.
String | getFormattedCurrentSteps() Retrieves the number of steps this user has gone toward unlocking this achievement (formatted for the user's locale); only applicable for `TYPE_INCREMENTAL` achievement types.
void | getFormattedTotalSteps(CharArrayBuffer dataOut) Loads the total number of steps necessary to unlock this achievement (formatted for the user's locale) into the given `CharArrayBuffer`; only applicable for `TYPE_INCREMENTAL` achievement types.
String | getFormattedTotalSteps() Retrieves the total number of steps necessary to unlock this achievement, formatted for the user's locale; only applicable for `TYPE_INCREMENTAL` achievement types.
long | getLastUpdatedTimestamp() Retrieves the timestamp (in millseconds since epoch) at which this achievement was last updated.
String | getName() Retrieves the name of this achievement.
void | getName(CharArrayBuffer dataOut) Loads the achievement name into the given `CharArrayBuffer`.
Player | getPlayer() Retrieves the player information associated with this achievement.
Uri | getRevealedImageUri() Retrieves a URI that can be used to load the achievement's revealed image icon.
String | getRevealedImageUrl()
int | getState() Retrieves the state of the achievement - one of `STATE_UNLOCKED`, `STATE_REVEALED`, or `STATE_HIDDEN`.
int | getTotalSteps() Retrieves the total number of steps necessary to unlock this achievement; only applicable for `TYPE_INCREMENTAL` achievement types.
int | getType() Retrieves the type of this achievement - one of `TYPE_STANDARD` or `TYPE_INCREMENTAL`.
Uri | getUnlockedImageUri() Retrieves a URI that can be used to load the achievement's unlocked image icon.
String | getUnlockedImageUrl()
long | getXpValue() Retrieves the XP value of this achievement.
int | hashCode()
boolean | isDataValid() Check to see if this object is valid for use.
String | toString()
void | writeToParcel(Parcel dest, int flags)

[Expand] Inherited Methods
From class java.lang.Object
Object | clone()
boolean | equals(Object arg0)
void | finalize()
final Class<?> | getClass()
int | hashCode()
final void | notify()
final void | notifyAll()
String | toString()
final void | wait()
final void | wait(long arg0, int arg1)
final void | wait(long arg0)
From interface com.google.android.gms.games.achievement.Achievement
abstract String | getAchievementId() Retrieves the ID of this achievement.
abstract int | getCurrentSteps() Retrieves the number of steps this user has gone toward unlocking this achievement; only applicable for `TYPE_INCREMENTAL` achievement types.
abstract String | getDescription() Retrieves the description for this achievement.
abstract void | getDescription(CharArrayBuffer dataOut) Loads the achievement description into the given `CharArrayBuffer`.
abstract void | getFormattedCurrentSteps(CharArrayBuffer dataOut) Retrieves the number of steps this user has gone toward unlocking this achievement (formatted for the user's locale) into the given `CharArrayBuffer`.
abstract String | getFormattedCurrentSteps() Retrieves the number of steps this user has gone toward unlocking this achievement (formatted for the user's locale); only applicable for `TYPE_INCREMENTAL` achievement types.
abstract void | getFormattedTotalSteps(CharArrayBuffer dataOut) Loads the total number of steps necessary to unlock this achievement (formatted for the user's locale) into the given `CharArrayBuffer`; only applicable for `TYPE_INCREMENTAL` achievement types.
abstract String | getFormattedTotalSteps() Retrieves the total number of steps necessary to unlock this achievement, formatted for the user's locale; only applicable for `TYPE_INCREMENTAL` achievement types.
abstract long | getLastUpdatedTimestamp() Retrieves the timestamp (in millseconds since epoch) at which this achievement was last updated.
abstract void | getName(CharArrayBuffer dataOut) Loads the achievement name into the given `CharArrayBuffer`.
abstract String | getName() Retrieves the name of this achievement.
abstract Player | getPlayer() Retrieves the player information associated with this achievement.
abstract Uri | getRevealedImageUri() Retrieves a URI that can be used to load the achievement's revealed image icon.
abstract int | getState() Retrieves the state of the achievement - one of `STATE_UNLOCKED`, `STATE_REVEALED`, or `STATE_HIDDEN`.
abstract int | getTotalSteps() Retrieves the total number of steps necessary to unlock this achievement; only applicable for `TYPE_INCREMENTAL` achievement types.
abstract int | getType() Retrieves the type of this achievement - one of `TYPE_STANDARD` or `TYPE_INCREMENTAL`.
abstract Uri | getUnlockedImageUri() Retrieves a URI that can be used to load the achievement's unlocked image icon.
abstract long | getXpValue() Retrieves the XP value of this achievement.
From interface android.os.Parcelable
abstract int | describeContents()
abstract void | writeToParcel(Parcel arg0, int arg1)
From interface com.google.android.gms.common.data.Freezable
abstract Achievement | freeze() Freeze a volatile representation into an immutable representation.
abstract boolean | isDataValid() Check to see if this object is valid for use.

## Fields

#### public static final AchievementEntityCreator CREATOR

## Public Methods

#### public int describeContents ()

#### public boolean equals (Object obj)

#### public Achievement freeze ()

Freeze a volatile representation into an immutable representation. Objects returned from this call are safe to cache.

Note that the output of `freeze` may not be identical to the parent object, but should be equal. In other words:

     Freezable f1 = new Freezable();
     Freezable f2 = f1.freeze();
     f1 == f2 may not be true.
     f1.equals(f2) will be true.

##### Returns

- A concrete implementation of the data object.

#### public String getAchievementId ()

Retrieves the ID of this achievement.

##### Returns

- The achievement ID.

#### public int getCurrentSteps ()

Retrieves the number of steps this user has gone toward unlocking this achievement; only applicable for `TYPE_INCREMENTAL` achievement types.

##### Returns

- The number of steps this user has gone toward unlocking this achievement.

#### public String getDescription ()

Retrieves the description for this achievement.

##### Returns

- The achievement description.

#### public void getDescription (CharArrayBuffer dataOut)

Loads the achievement description into the given `CharArrayBuffer`.

##### Parameters

dataOut | The buffer to load the data into.

#### public void getFormattedCurrentSteps (CharArrayBuffer dataOut)

Retrieves the number of steps this user has gone toward unlocking this achievement (formatted for the user's locale) into the given `CharArrayBuffer`.

##### Parameters

dataOut | The buffer to load the data into.

#### public String getFormattedCurrentSteps ()

Retrieves the number of steps this user has gone toward unlocking this achievement (formatted for the user's locale); only applicable for `TYPE_INCREMENTAL` achievement types.

##### Returns

- The formatted number of steps this user has gone toward unlocking this achievement,

#### public void getFormattedTotalSteps (CharArrayBuffer dataOut)

Loads the total number of steps necessary to unlock this achievement (formatted for the user's locale) into the given `CharArrayBuffer`; only applicable for `TYPE_INCREMENTAL` achievement types.

##### Parameters

dataOut | The buffer to load the data into.

#### public String getFormattedTotalSteps ()

Retrieves the total number of steps necessary to unlock this achievement, formatted for the user's locale; only applicable for `TYPE_INCREMENTAL` achievement types.

##### Returns

- The total number of steps necessary to unlock this achievement.

#### public long getLastUpdatedTimestamp ()

Retrieves the timestamp (in millseconds since epoch) at which this achievement was last updated. If the achievement has never been updated, this will return -1.

##### Returns

- Timestamp at which this achievement was last updated.

#### public String getName ()

Retrieves the name of this achievement.

##### Returns

- The achievement name.

#### public void getName (CharArrayBuffer dataOut)

Loads the achievement name into the given `CharArrayBuffer`.

##### Parameters

dataOut | The buffer to load the data into.

#### public Player getPlayer ()

Retrieves the player information associated with this achievement.

Note that this object is a volatile representation, so it is not safe to cache the output of this directly. Instead, cache the result of `freeze()`.

##### Returns

- The player associated with this achievement.

#### public Uri getRevealedImageUri ()

Retrieves a URI that can be used to load the achievement's revealed image icon. Returns null if the achievement has no revealed image.

To retrieve the Image from the `Uri`, use `ImageManager`.

##### Returns

- The image URI for the achievement's revealed image icon, or null if the achievement has no revealed image.

#### public String getRevealedImageUrl ()

#### public int getState ()

Retrieves the state of the achievement - one of `STATE_UNLOCKED`, `STATE_REVEALED`, or `STATE_HIDDEN`.

##### Returns

- The state of this achievement.

#### public int getTotalSteps ()

Retrieves the total number of steps necessary to unlock this achievement; only applicable for `TYPE_INCREMENTAL` achievement types.

##### Returns

- The total number of steps necessary to unlock this achievement.

#### public int getType ()

Retrieves the type of this achievement - one of `TYPE_STANDARD` or `TYPE_INCREMENTAL`.

##### Returns

- The type of this achievement.

#### public Uri getUnlockedImageUri ()

Retrieves a URI that can be used to load the achievement's unlocked image icon. Returns null if the achievement has no unlocked image.

To retrieve the Image from the `Uri`, use `ImageManager`.

##### Returns

- The image URI for the achievement's unlocked image icon, or null if the achievement has no unlocked image.

#### public String getUnlockedImageUrl ()

#### public long getXpValue ()

Retrieves the XP value of this achievement.

##### Returns

- XP value given to players for unlocking this achievement.

#### public int hashCode ()

#### public boolean isDataValid ()

Check to see if this object is valid for use. If the object is still volatile, this method will indicate whether or not the object can be safely used. The output of a call to `freeze()` will always be valid.

##### Returns

- whether or not the object is valid for use.

#### public String toString ()

#### public void writeToParcel (Parcel dest, int flags)