Summary: Constants | Inherited Constants | Fields | Methods | Inherited Methods | [Expand All]
public interface

# Quest

implements Freezable<Quest> Parcelable

com.google.android.gms.games.quest.Quest

Known Indirect Subclasses QuestEntity
QuestEntity | Data object representing the data for a quest.

## Class Overview

Data interface for retrieving quest information.

## Summary

Constants
int | STATE_ACCEPTED | Constant returned by `getState()` indicating the player has accepted the quest.
int | STATE_COMPLETED | Constant returned by `getState()` indicating the player has completed the quest.
int | STATE_EXPIRED | Constant returned by `getState()` indicating the quest is over and this player never accepted the quest.
int | STATE_FAILED | Constant returned by `getState()` indicating the quest is over and this player did not complete the quest.
int | STATE_OPEN | Constant returned by `getState()` indicating players can now accept this quest.
int | STATE_UPCOMING | Constant returned by `getState()` indicating the quest happens in the future, so it is visible to the UI, but players can't accept it yet.
long | UNSET_QUEST_TIMESTAMP | The default value for Quest related timestamps when they aren't set by the server.

[Expand] Inherited Constants
From interface android.os.Parcelable
int | CONTENTS_FILE_DESCRIPTOR |
int | PARCELABLE_WRITE_RETURN_VALUE |

Fields
public static final int[] | QUEST_STATE_ALL | Array of all the valid state constants.
public static final String[] | QUEST_STATE_NON_TERMINAL |

Public Methods
abstract long | getAcceptedTimestamp() Retrieves the timestamp (in milliseconds since epoch) at which this quest was accepted by the player.
abstract Uri | getBannerImageUri() Retrieves a URI that can be used to load the quest's banner image.
abstract Milestone | getCurrentMilestone() Retrieves the latest milestone information associated with this quest.
abstract String | getDescription() Retrieves the description for this quest.
abstract void | getDescription(CharArrayBuffer dataOut) Loads the quest description into the given `CharArrayBuffer`.
abstract long | getEndTimestamp() Timestamp at which this quest will change to STATE_EXPIRED if not accepted, or change to STATE_FAILED if accepted but not completed.
abstract Game | getGame() Retrieves the game metadata associated with this quest.
abstract Uri | getIconImageUri() Retrieves a URI that can be used to load the quest's icon image.
abstract long | getLastUpdatedTimestamp() Retrieves the timestamp (in milliseconds since epoch) at which this quest was last updated.
abstract void | getName(CharArrayBuffer dataOut) Loads the quest name into the given `CharArrayBuffer`.
abstract String | getName() Retrieves the name of this quest.
abstract String | getQuestId() Retrieves the ID of this quest.
abstract long | getStartTimestamp() Retrieves the timestamp (in milliseconds since epoch) at which this quest will be available for players to accept.
abstract int | getState() Retrieves the state of the quest - one of `STATE_UPCOMING`, `STATE_OPEN`, `STATE_COMPLETED`, `STATE_EXPIRED`, `STATE_FAILED`, `STATE_ACCEPTED`.
abstract boolean | isEndingSoon() Indicates whether the quest will be expiring soon

[Expand] Inherited Methods
From interface com.google.android.gms.common.data.Freezable
abstract Quest | freeze() Freeze a volatile representation into an immutable representation.
abstract boolean | isDataValid() Check to see if this object is valid for use.
From interface android.os.Parcelable
abstract int | describeContents()
abstract void | writeToParcel(Parcel arg0, int arg1)

## Constants

#### public static final int STATE_ACCEPTED

Constant returned by `getState()` indicating the player has accepted the quest.

Constant Value: 3 (0x00000003)

#### public static final int STATE_COMPLETED

Constant returned by `getState()` indicating the player has completed the quest.

Constant Value: 4 (0x00000004)

#### public static final int STATE_EXPIRED

Constant returned by `getState()` indicating the quest is over and this player never accepted the quest.

Constant Value: 5 (0x00000005)

#### public static final int STATE_FAILED

Constant returned by `getState()` indicating the quest is over and this player did not complete the quest.

Constant Value: 6 (0x00000006)

#### public static final int STATE_OPEN

Constant returned by `getState()` indicating players can now accept this quest.

Constant Value: 2 (0x00000002)

#### public static final int STATE_UPCOMING

Constant returned by `getState()` indicating the quest happens in the future, so it is visible to the UI, but players can't accept it yet.

Constant Value: 1 (0x00000001)

#### public static final long UNSET_QUEST_TIMESTAMP

The default value for Quest related timestamps when they aren't set by the server.

Constant Value: -1 (0xffffffffffffffff)

## Fields

#### public static final int[] QUEST_STATE_ALL

Array of all the valid state constants.

#### public static final String[] QUEST_STATE_NON_TERMINAL

## Public Methods

#### public abstract long getAcceptedTimestamp ()

Retrieves the timestamp (in milliseconds since epoch) at which this quest was accepted by the player. If the quest has never been accepted, this will return `UNSET_QUEST_TIMESTAMP`. If you are looking for the time that a quest is available to be accepted, see `getStartTimestamp()`. This value should always be greater than `getStartTimestamp()` and less than `getEndTimestamp()`

##### Returns

- Timestamp at which this quest was accepted.

#### public abstract Uri getBannerImageUri ()

Retrieves a URI that can be used to load the quest's banner image. Returns null if the quest has no banner image.

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

##### Returns

- The image URI for the quest's banner image, or null if the quest has no banner image.

#### public abstract Milestone getCurrentMilestone ()

Retrieves the latest milestone information associated with this quest.

##### Returns

- The latest milestone associated with this quest.

#### public abstract String getDescription ()

Retrieves the description for this quest.

##### Returns

- The quest description.

#### public abstract void getDescription (CharArrayBuffer dataOut)

Loads the quest description into the given `CharArrayBuffer`.

##### Parameters

dataOut | The buffer to load the data into.

#### public abstract long getEndTimestamp ()

Timestamp at which this quest will change to STATE_EXPIRED if not accepted, or change to STATE_FAILED if accepted but not completed.

##### Returns

- Timestamp at which this quest will end.

#### public abstract Game getGame ()

Retrieves the game metadata associated with this quest.

##### Returns

- The game associated with the quest.

#### public abstract Uri getIconImageUri ()

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

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

##### Returns

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

#### public abstract long getLastUpdatedTimestamp ()

Retrieves the timestamp (in milliseconds since epoch) at which this quest was last updated. If the quest has never been updated, this will return `UNSET_QUEST_TIMESTAMP`.

##### Returns

- Timestamp at which this quest was last updated.

#### public abstract void getName (CharArrayBuffer dataOut)

Loads the quest name into the given `CharArrayBuffer`.

##### Parameters

dataOut | The buffer to load the data into.

#### public abstract String getName ()

Retrieves the name of this quest.

##### Returns

- The quest name.

#### public abstract String getQuestId ()

Retrieves the ID of this quest.

##### Returns

- The quest ID.

#### public abstract long getStartTimestamp ()

Retrieves the timestamp (in milliseconds since epoch) at which this quest will be available for players to accept. If you are looking for the time that a quest was accepted by the player, see `getAcceptedTimestamp()`

##### Returns

- Timestamp at which this quest will begin.

#### public abstract int getState ()

Retrieves the state of the quest - one of `STATE_UPCOMING`, `STATE_OPEN`, `STATE_COMPLETED`, `STATE_EXPIRED`, `STATE_FAILED`, `STATE_ACCEPTED`.

##### Returns

- The state of this quest.

#### public abstract boolean isEndingSoon ()

Indicates whether the quest will be expiring soon

##### Returns

- Is the quest expiring soon.