java.lang.Object | ||
↳ | com.google.android.gms.common.api.GoogleApi<com.google.android.gms.games.Games.GamesOptions> | |
↳ | com.google.android.gms.games.GamesClient |
A client to interact with games basic functionality.
Public Methods | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
Returns a
Task which asynchronously loads the application ID linked to this client
instance. | |||||||||||
Returns a
Task which asynchronously loads the name of the currently selected account. | |||||||||||
Returns a
Task which asynchronously sets the part of the screen at which games service
pop-ups (for example, "welcome back" or "achievement unlocked" popups) will be displayed using
gravity. | |||||||||||
[Expand]
Inherited Methods | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
![]() |
Returns a Task
which asynchronously loads a Bundle
that may contain an
information regarding to the previous user's action.
The Task
returned will not be null, but the Bundle
returned from the Task
may be null if it was already received or there is no related data found.
Unless a new user action is performed all the subsequent calls will return a Task
with a null Bundle
.
A Bundle
can contain the following keys:
EXTRA_INVITATION
if the user
wanted to accept an invitation to a multiplayer game. The value contained here is an
Invitation
which can be accessed with
getParcelable(String)
.
EXTRA_TURN_BASED_MATCH
if
the user wanted to take action in a turn-based match. The value contained here is a
TurnBasedMatch
which can be
accessed with getParcelable(String)
.
EXTRA_REQUESTS
if the user wanted
to accept one or more requests. The value contained here is a list of GameRequest
objects which can be accessed with
getParcelableArrayList(String)
.
EXTRA_SNAPSHOT_METADATA
if the
user wanted to resume a saved game. The value contained here is a SnapshotMetadata
object which can be accessed with
getParcelable(String)
.
EXTRA_QUEST
if the user wanted to
accept a specific quest. The value contained here is a Quest
which can be accessed with getParcelable(String)
.
Returns | |
---|---|
Task<Bundle> |
Returns a Task
which asynchronously loads the application ID linked to this client
instance.
Required Scopes: SCOPE_GAMES_LITE
Returns | |
---|---|
Task<String> |
Returns a Task
which asynchronously loads the name of the currently selected account.
This is the account the user has chosen to use for Google Play Games.
The returned Task
can fail with a RemoteException
.
Note that your app must have <uses-permission
android:name="android.permission.GET_ACCOUNTS" />
declared in your manifest in order to use
this method. Otherwise the Task
will fail with SecurityException
.
Returns | |
---|---|
Task<String> |
Returns a Task
which asynchronously loads an Intent
to show the Settings screen
that allows the user to configure Games-related features for the current game. Note that this
must be invoked with startActivityForResult(Intent, int)
, so that the identity
of the calling package can be established.
The returned Task
can fail with a RemoteException
.
Most applications will not need to call this directly, since the Settings UI is already reachable from most other Games UI screens (achievements, leaderboards, etc.) via a menu item.
Required Scopes: SCOPE_GAMES_LITE
Returns | |
---|---|
Task<Intent> |
Returns a Task
which asynchronously sets the part of the screen at which games service
pop-ups (for example, "welcome back" or "achievement unlocked" popups) will be displayed using
gravity.
Default value is TOP
|CENTER_HORIZONTAL
.
Required Scopes: SCOPE_GAMES_LITE
Parameters | |
---|---|
gravity |
int : The gravity which controls the placement of games service pop-ups.
|
Returns | |
---|---|
Task<Void> |
Returns a Task
which asynchronously sets the View
to use as a content view for
popups.
Required Scopes: SCOPE_GAMES_LITE
Parameters | |
---|---|
gamesContentView |
View : The view to use as a content view for popups. View cannot be null.
|
Returns | |
---|---|
Task<Void> |