Page Summary
-
The GamesClient interface is deprecated and users should migrate to the games v2 API.
-
A migration guide is available to assist with the transition to games v2.
-
The interface provides basic functionality for interacting with games, although all its methods are deprecated.
-
Deprecated methods include retrieving activation hints, application ID, current account name, settings intent, and setting popup gravity and view.
This interface is deprecated.
Consider migrating to the games v2. Refer to the migration
guide
.
A client to interact with games basic functionality.
Public Method Summary
| abstract Task< Bundle > | |
| abstract Task< String > | getAppId
()
|
| abstract Task< String > | |
| abstract Task< Intent > | |
| abstract Task< Void > | setGravityForPopups
(int gravity)
|
| abstract Task< Void > |
Public Methods
public abstract Task< Bundle > getActivationHint ()
This method is deprecated.
Consider migrating to the games v2. Refer to the migration
guide
.
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:
-
SnapshotsClient.EXTRA_SNAPSHOT_METADATAif the user wanted to resume a saved game. The value contained here is aSnapshotMetadataobject which can be accessed withBundle.getParcelable(String).
public abstract Task< String > getAppId ()
This method is deprecated.
Consider migrating to the games v2. Refer to the migration
guide
.
Returns a Task
which asynchronously loads the application ID linked to this client instance.
public abstract Task< String > getCurrentAccountName ()
This method is deprecated.
Consider migrating to the games v2. Refer to the migration
guide
.
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
.
public abstract Task< Intent > getSettingsIntent ()
This method is deprecated.
Consider migrating to the games v2. Refer to the migration
guide
.
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 Activity.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.
public abstract Task< Void > setGravityForPopups (int gravity)
This method is deprecated.
Consider migrating to the games v2. Refer to the migration
guide
.
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 Gravity.TOP
| Gravity.CENTER_HORIZONTAL
.
Parameters
public abstract Task< Void > setViewForPopups ( View gamesContentView)
This method is deprecated.
Consider migrating to the games v2. Refer to the migration
guide
.

