# SessionListener

* The Interface SessionListener monitors all the events from the Session.
* The SessionListener is created together with the Session instance.

## Public Method Summary

Public Method Summary

| Type | Methods                                                                                                                                                                                                               | Parameters                                                                                                                                                                                                                                 |
| ---- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
| void | <p>onConnected(List\<Participant> participants)</p><p>Connect to session</p>                                                                                                                                          | <ul><li><strong>participants</strong> - List of participants in the Session</li></ul>                                                                                                                                                      |
| void | <p>onDisconnected() -<br>Session is disconnected</p>                                                                                                                                                                  | <p><br></p>                                                                                                                                                                                                                                |
| void | <p>onError(SessionError error)  - <br>Receive error message</p>                                                                                                                                                       | <ul><li><strong>error</strong> -Detailed error information</li></ul>                                                                                                                                                                       |
| void | <p>onLocalParticipantJoined(final Participant participant) -</p><p>local participant is connected to session</p>                                                                                                      | <ul><li><strong>participant</strong> - Participant object representing the local device and media stream with audio and video tracks inside</li></ul>                                                                                      |
| void | onRemoteParticipantJoined(final Participant participant) -                                                                                                                                                            | <ul><li><strong>participant</strong> - Participant object representing a remote device and media stream with audio and video tracks inside</li></ul>                                                                                       |
| void | onUpdateParticipant(String participantId, Participant participant)                                                                                                                                                    | <ul><li><strong>participantId</strong> - the unique String value of the participant</li><li>participant - Participant object representing a remote device</li></ul>                                                                        |
| void | onRemoteParticipantLeft(final Participant participant)                                                                                                                                                                | <ul><li><strong>participantId</strong> - the unique String value of the participant</li></ul>                                                                                                                                              |
| void | <p>onParticipantMediaStateChanged(final String participantId, final MediaConfiguration.MediaType mediaType, final MediaConfiguration.MediaState mediaState) -</p><p>This method handle participant's media states</p> | <ul><li><strong>participantId</strong> - the unique String value of the participant</li><li><strong>mediaType</strong> - Enum of AUDIO, VIDEO, ALL values</li><li><strong>mediaState</strong> - Enum of ENABLED, DISABLED values</li></ul> |
| void | <p>onMessageReceived(final String participantId, final String message)</p><p>The method is receiving messages from remote participants into the current room</p>                                                      | <ul><li><strong>participantId</strong> - the unique String value of the participant</li><li><strong>message</strong> - receiving string messages</li></ul>                                                                                 |


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://documentation.sceenic.co/watch-together-sdk/sscale-confluence-api-references/android-reference-new/sessionlistener.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
