...
To explore the code, use the class AudioChatActivity.java of the audio chat example which is available to download in the Android SDK build 1.1.0.61.
Unlike a direct connection to server with method createSession()
, the RoomManager
object is used for managing connection to the server room. Connection to the server is established when RoomManager
object is created, and method RoomManager.join()
is called to join a room.
The Room
object is created to work with the room locally when joined. A Participant
objects are used to work with room participants locally.
All events occurring in the room (a user joined/left, or sent a message), are sent to all users connected to the room.
For example, in the following code, a user joins a room and gets the list of already connected users:
Code Block | ||||
---|---|---|---|---|
| ||||
room = roomManager.join(roomOptions); room.on(new RoomEvent() { public void onState(final Room room) { for (final Participant participant : room.getParticipants()) { ... } ... } ... }); |
...
Code Block | ||||
---|---|---|---|---|
| ||||
renderer = new SurfaceViewRenderer(this); |
3.
...
Connection to the server
Flashphoner.createRoomManager()
code
The RoomManagerOptions
object is passed to teh the method with the following parameters:
...