com.google.android.gms.games.Players |
Entry point for player functionality.
Nested Classes | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
Players.LoadPlayersResult | Result delivered when player data has been loaded. | ||||||||||
Players.LoadProfileSettingsResult | Result delivered when the profile settings of the signed-in player have been loaded. |
Constants | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
String | EXTRA_PLAYER_SEARCH_RESULTS | Used by the Player Search UI to return a list of parceled Player objects. |
Public Methods | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
Get the current signed in player, if available.
| |||||||||||
Get the current signed in player ID, if available.
| |||||||||||
Returns an intent that will display a screen where the user can search for people on Google+.
| |||||||||||
Asynchronously loads a list of players that have connected to this game (and that
the user has permission to know about).
| |||||||||||
Load the initial page of players the currently signed-in player can invite to a multiplayer
game, sorted alphabetically by name.
| |||||||||||
Asynchronously loads an additional page of invitable players.
| |||||||||||
Asynchronously loads an additional page of players that the signed-in player has played
multiplayer games with recently.
| |||||||||||
Loads the profile for the requested player ID.
| |||||||||||
Loads the profile for the requested player ID.
| |||||||||||
Load the initial page of players the currently signed-in player has played multiplayer games
with recently, starting with the most recent.
|
Used by the Player Search UI to return a list of parceled Player objects. Retrieve with
getParcelableArrayListExtra(String)
.
Get the current signed in player, if available.
Required API: API
Required Scopes: SCOPE_GAMES
apiClient | The GoogleApiClient to service the call. |
---|
Player
representing the currently signed in player. May be null if an error
occurred while communicating with the games service.
Get the current signed in player ID, if available.
Required API: API
Required Scopes: SCOPE_GAMES
apiClient | The GoogleApiClient to service the call. |
---|
Returns an intent that will display a screen where the user can search for people on Google+.
Note that this must be invoked with startActivityForResult(Intent, int)
, so
that the identity of the calling package can be established.
If the user canceled, the result will be RESULT_CANCELED
. If the user
selected any players from the search results list, the result will be
RESULT_OK
, and the data intent will contain a list of parceled Player
objects in EXTRA_PLAYER_SEARCH_RESULTS
.
Note that the current Player Search UI only allows a single selection, so the returned list of parceled Player objects will currently contain at most one Player. The Player Search UI may allow multiple selections in a future release, though.
Required API: API
Required Scopes: SCOPE_GAMES
apiClient | The GoogleApiClient to service the call. |
---|
Intent
that can be started to display the player selector.
Asynchronously loads a list of players that have connected to this game (and that the user has permission to know about).
Required API: API
Required Scopes: SCOPE_GAMES
apiClient | The GoogleApiClient to service the call. |
---|---|
forceReload | If true, this call will clear any locally cached data and attempt to fetch the latest data from the server. This would commonly be used for something like a user-initiated refresh. Normally, this should be set to false to gain advantages of data caching. |
Load the initial page of players the currently signed-in player can invite to a multiplayer game, sorted alphabetically by name.
Required API: API
Required Scopes: SCOPE_GAMES
apiClient | The GoogleApiClient to service the call. |
---|---|
pageSize | The number of entries to request for this initial page. Note that if cached data already exists, the returned buffer may contain more than this size, but it is guaranteed to contain at least this many if the collection contains enough records. This must be a value between 1 and 25. |
forceReload | If true, this call will clear any locally cached data and attempt to fetch the latest data from the server. This would commonly be used for something like a user-initiated refresh. Normally, this should be set to false to gain advantages of data caching. |
PendingResult
to access the data when available.
Asynchronously loads an additional page of invitable players. A new player buffer will be delivered that includes an extra page of results.
Required API: API
Required Scopes: SCOPE_GAMES
apiClient | The GoogleApiClient to service the call. |
---|---|
pageSize | The number of additional entries to request. This must be a value between 1 and 25. |
PendingResult
to access the data when available.
Asynchronously loads an additional page of players that the signed-in player has played multiplayer games with recently. A new player buffer will be delivered that includes an extra page of results.
Required API: API
Required Scopes: SCOPE_GAMES
apiClient | The GoogleApiClient to service the call. |
---|---|
pageSize | The number of additional entries to request. This must be a value between 1 and 25. |
PendingResult
to access the data when available.
Loads the profile for the requested player ID.
Required API: API
Required Scopes: SCOPE_GAMES
apiClient | The GoogleApiClient to service the call. |
---|---|
playerId | The player ID to get full profile data for. |
forceReload | If true, this call will clear any locally cached data and attempt to fetch the latest data from the server. This would commonly be used for something like a user-initiated refresh. Normally, this should be set to false to gain advantages of data caching. |
PendingResult
to access the data when available.
Loads the profile for the requested player ID.
Required API: API
Required Scopes: SCOPE_GAMES
apiClient | The GoogleApiClient to service the call. |
---|---|
playerId | The player ID to get full profile data for. |
PendingResult
to access the data when available.
Load the initial page of players the currently signed-in player has played multiplayer games with recently, starting with the most recent.
Required API: API
Required Scopes: SCOPE_GAMES
apiClient | The GoogleApiClient to service the call. |
---|---|
pageSize | The number of entries to request for this initial page. Note that if cached data already exists, the returned buffer may contain more than this size, but it is guaranteed to contain at least this many if the collection contains enough records. This must be a value between 1 and 25. |
forceReload | If true, this call will clear any locally cached data and attempt to fetch the latest data from the server. This would commonly be used for something like a user-initiated refresh. Normally, this should be set to false to gain advantages of data caching. |
PendingResult
to access the data when available.