> ## Documentation Index
> Fetch the complete documentation index at: https://www.cometchat.com/docs/llms.txt
> Use this file to discover all available pages before exploring further.

# Screen Sharing

> CometChat Calling SDK v5 - Screen Sharing for Android

View screen shares from other participants during a call. The Android SDK can receive and display screen shares initiated from web clients.

<Note>
  The Android Calls SDK does not support initiating screen sharing. Screen sharing can only be started from web clients. Android participants can view shared screens.
</Note>

## How It Works

When a web participant starts screen sharing:

1. The SDK receives the screen share stream
2. The call layout automatically adjusts to display the shared screen prominently
3. Android participants can view the shared content

## Listen for Screen Share Events

Monitor when participants start or stop screen sharing:

<Tabs>
  <Tab title="Kotlin">
    ```kotlin theme={null}
    val callSession = CallSession.getInstance()

    callSession.addParticipantEventListener(this, object : ParticipantEventListener() {
        override fun onParticipantStartedScreenShare(participant: Participant) {
            Log.d(TAG, "${participant.name} started screen sharing")
            // Layout automatically adjusts to show shared screen
        }

        override fun onParticipantStoppedScreenShare(participant: Participant) {
            Log.d(TAG, "${participant.name} stopped screen sharing")
            // Layout returns to normal view
        }

        // Other callbacks...
        override fun onParticipantJoined(participant: Participant) {}
        override fun onParticipantLeft(participant: Participant) {}
        override fun onParticipantListChanged(participants: List<Participant>) {}
        override fun onParticipantAudioMuted(participant: Participant) {}
        override fun onParticipantAudioUnmuted(participant: Participant) {}
        override fun onParticipantVideoPaused(participant: Participant) {}
        override fun onParticipantVideoResumed(participant: Participant) {}
        override fun onParticipantStartedRecording(participant: Participant) {}
        override fun onParticipantStoppedRecording(participant: Participant) {}
        override fun onParticipantHandRaised(participant: Participant) {}
        override fun onParticipantHandLowered(participant: Participant) {}
        override fun onDominantSpeakerChanged(participant: Participant) {}
    })
    ```
  </Tab>

  <Tab title="Java">
    ```java theme={null}
    CallSession callSession = CallSession.getInstance();

    callSession.addParticipantEventListener(this, new ParticipantEventListener() {
        @Override
        public void onParticipantStartedScreenShare(Participant participant) {
            Log.d(TAG, participant.getName() + " started screen sharing");
            // Layout automatically adjusts to show shared screen
        }

        @Override
        public void onParticipantStoppedScreenShare(Participant participant) {
            Log.d(TAG, participant.getName() + " stopped screen sharing");
            // Layout returns to normal view
        }

        // Other callbacks...
    });
    ```
  </Tab>
</Tabs>

## Check Screen Share Status

Use the `isPresenting` property on the `Participant` object to check if someone is sharing their screen:

<Tabs>
  <Tab title="Kotlin">
    ```kotlin theme={null}
    callSession.addParticipantEventListener(this, object : ParticipantEventListener() {
        override fun onParticipantListChanged(participants: List<Participant>) {
            val presenter = participants.find { it.isPresenting }
            if (presenter != null) {
                Log.d(TAG, "${presenter.name} is currently sharing their screen")
            }
        }
    })
    ```
  </Tab>

  <Tab title="Java">
    ```java theme={null}
    callSession.addParticipantEventListener(this, new ParticipantEventListener() {
        @Override
        public void onParticipantListChanged(List<Participant> participants) {
            for (Participant p : participants) {
                if (p.isPresenting()) {
                    Log.d(TAG, p.getName() + " is currently sharing their screen");
                    break;
                }
            }
        }
    });
    ```
  </Tab>
</Tabs>
