RoomConfig | Android Developers

Quicknav Quicknav
Links

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

Android Sites

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

Language
close

- - About
  - Wear
  - TV
  - Auto
- - Get Started
  - Devices
  - Style
  - Patterns
  - Building Blocks
  - Downloads
  - Videos
- - Training
  - API Guides
  - Reference
  - Tools
  - Google Services
  - Samples
- - Google Play
  - Essentials
  - Get Users
  - Engage & Retain
  - Monetize
  - Tools & Reference
  - Developer Stories

## Results

Loading...
Summary: Nested Classes | Methods | Inherited Methods | [Expand All]
public final class

# RoomConfig

extends Object

java.lang.Object
↳ | com.google.android.gms.games.multiplayer.realtime.RoomConfig

## Class Overview

Configuration for a new room.

## Summary

Nested Classes
class | RoomConfig.Builder | Builder class for `RoomConfig`.

Public Methods
static RoomConfig.Builder | builder(RoomUpdateListener listener) Creates a builder for assembling a `RoomConfig`.
static Bundle | createAutoMatchCriteria(int minAutoMatchPlayers, int maxAutoMatchPlayers, long exclusiveBitMask) Creates an auto-match criteria `Bundle` for a new invitation.
Bundle | getAutoMatchCriteria() Retrieves the criteria for auto-matching one or more players for the room.
String | getInvitationId() Retrieves the ID of the invitation to accept, if any.
String[] | getInvitedPlayerIds() Retrieves the player IDs to invite to the room.
RealTimeMessageReceivedListener | getMessageReceivedListener() Retrieves the listener for message received from a peer.
RoomStatusUpdateListener | getRoomStatusUpdateListener() Retrieves the listener for the room status changes.
RoomUpdateListener | getRoomUpdateListener() Retrieves the listener that is called when operations complete.
int | getVariant() Retrieves the (optional) developer-controlled parameter describing the type of game to play.
boolean | isSocketEnabled() Indicates whether to enable the use of sockets for sending/receiving data.

[Expand] Inherited Methods
From class java.lang.Object
Object | clone()
boolean | equals(Object arg0)
void | finalize()
final Class<?> | getClass()
int | hashCode()
final void | notify()
final void | notifyAll()
String | toString()
final void | wait()
final void | wait(long arg0, int arg1)
final void | wait(long arg0)

## Public Methods

#### public static RoomConfig.Builder builder (RoomUpdateListener listener)

Creates a builder for assembling a `RoomConfig`. The provided listener is required, and must not be null. It will be invoked on the main thread when appropriate.

##### Parameters

listener | The listener to be invoked when the primary state of the room changes.

##### Returns

- An instance of a builder.

#### public static Bundle createAutoMatchCriteria (int minAutoMatchPlayers, int maxAutoMatchPlayers, long exclusiveBitMask)

Creates an auto-match criteria `Bundle` for a new invitation. Can be passed to `setAutoMatchCriteria(Bundle)`.

##### Parameters

minAutoMatchPlayers | Minimum number of auto-matched players.
maxAutoMatchPlayers | Maximum number of auto-matched players.
exclusiveBitMask | Exclusive bitmasks for the automatching request. The logical AND of each pairing of automatching requests must equal zero for auto-match. If there are no exclusivity requirements for the game, this value should just be set to 0.

##### Returns

- A bundle of auto-match criteria data.

#### public Bundle getAutoMatchCriteria ()

Retrieves the criteria for auto-matching one or more players for the room.

##### Returns

- The criteria for auto-matching one or more players for the room.

#### public String getInvitationId ()

Retrieves the ID of the invitation to accept, if any. This is necessary when calling `join(GoogleApiClient, RoomConfig)`.

##### Returns

- The ID of the invitation to accept.

#### public String[] getInvitedPlayerIds ()

Retrieves the player IDs to invite to the room.

##### Returns

- The player IDs to invite to the room.

#### public RealTimeMessageReceivedListener getMessageReceivedListener ()

Retrieves the listener for message received from a peer.

##### Returns

- The `RealTimeMessageReceivedListener` that is called when the client has received a message from a peer.

#### public RoomStatusUpdateListener getRoomStatusUpdateListener ()

Retrieves the listener for the room status changes.

##### Returns

- The `RoomStatusUpdateListener` that is called when the room status has changed.

#### public RoomUpdateListener getRoomUpdateListener ()

Retrieves the listener that is called when operations complete.

##### Returns

- The listener that is called when operations complete.

#### public int getVariant ()

Retrieves the (optional) developer-controlled parameter describing the type of game to play. Must be either a positive integer or `ROOM_VARIANT_DEFAULT` if not desired.

##### Returns

- The developer-specified game variant.

#### public boolean isSocketEnabled ()

Indicates whether to enable the use of sockets for sending/receiving data.

##### Returns

- Whether to enable the use of sockets for sending/receiving data.