Quicknav Quicknav
Links

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

Android Sites

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

close

- - Get Started
  - Style
  - Patterns
  - Building Blocks
  - Downloads
  - Videos
- - Training
  - API Guides
  - Reference
  - Tools
    - Get the SDK
  - Google Services
- - Google Play
  - Publishing
  - Promoting
  - App Quality
  - Spotlight
  - Open Distribution

## Results

Loading...
public interface

# Multiplayer

com.google.android.gms.games.multiplayer.Multiplayer

## Class Overview

Common constants/methods for multiplayer functionality.

## Summary

Constants
String | EXTRA_EXCLUSIVE_BIT_MASK | Used to bundle the exclusive bit mask of the player for auto-match criteria.
String | EXTRA_INVITATION | Used to return an `Invitation`.
String | EXTRA_MAX_AUTOMATCH_PLAYERS | Used to return the maximum number of players that should be added to a room by auto-matching.
String | EXTRA_MIN_AUTOMATCH_PLAYERS | Used to return the minimum number of players that should be added to a room by auto-matching.
String | EXTRA_PLAYERS | Used to return a list of player IDs.
String | EXTRA_ROOM | Used to return a `Room`.
String | EXTRA_TURN_BASED_MATCH | Used to return a `TurnBasedMatch`.
int | MAX_RELIABLE_MESSAGE_LEN | This gives the maximum message size supported via the `sendReliableMessage(GoogleApiClient, RealTimeMultiplayer.ReliableMessageSentCallback, byte[], String, String)` methods (excluding protocol headers).
int | MAX_UNRELIABLE_MESSAGE_LEN | This gives the maximum (unfragmented) message size supported via the `sendUnreliableMessage(GoogleApiClient, byte[], String, String)` methods (excluding protocol headers).

## Constants

#### public static final String EXTRA_EXCLUSIVE_BIT_MASK

Used to bundle the exclusive bit mask of the player for auto-match criteria.

Constant Value: "exclusive_bit_mask"

#### public static final String EXTRA_INVITATION

Used to return an `Invitation`. Retrieve with `getParcelableExtra(String)` or `getParcelable(String)`.

Constant Value: "invitation"

#### public static final String EXTRA_MAX_AUTOMATCH_PLAYERS

Used to return the maximum number of players that should be added to a room by auto-matching. Retrieve with `getIntExtra(String, int)`.

##### See Also

- `getSelectOpponentsIntent(GoogleApiClient, int, int)`
- `getSelectOpponentsIntent(GoogleApiClient, int, int)`

Constant Value: "max_automatch_players"

#### public static final String EXTRA_MIN_AUTOMATCH_PLAYERS

Used to return the minimum number of players that should be added to a room by auto-matching. Retrieve with `getIntExtra(String, int)`.

##### See Also

- `getSelectOpponentsIntent(GoogleApiClient, int, int)`
- `getSelectOpponentsIntent(GoogleApiClient, int, int)`

Constant Value: "min_automatch_players"

#### public static final String EXTRA_PLAYERS

Used to return a list of player IDs. Retrieve with `getStringArrayListExtra(String)`.

##### See Also

- `getSelectOpponentsIntent(GoogleApiClient, int, int)`
- `getSelectOpponentsIntent(GoogleApiClient, int, int)`

Constant Value: "players"

#### public static final String EXTRA_ROOM

Used to return a `Room`. Retrieve with `getParcelableExtra(String)`.

Constant Value: "room"

#### public static final String EXTRA_TURN_BASED_MATCH

Used to return a `TurnBasedMatch`. Retrieve with `getParcelableExtra(String)` or `getParcelable(String)`.

Constant Value: "turn_based_match"

#### public static final int MAX_RELIABLE_MESSAGE_LEN

This gives the maximum message size supported via the `sendReliableMessage(GoogleApiClient, RealTimeMultiplayer.ReliableMessageSentCallback, byte[], String, String)` methods (excluding protocol headers).

Constant Value: 1400 (0x00000578)

#### public static final int MAX_UNRELIABLE_MESSAGE_LEN

This gives the maximum (unfragmented) message size supported via the `sendUnreliableMessage(GoogleApiClient, byte[], String, String)` methods (excluding protocol headers).

Constant Value: 1168 (0x00000490)