CreateBlogSupport
Log inSign up
Home
Webex Meetings
  • Overview
  • Guides
  • API Behavior Changes
  • REST API Basics
  • API REFERENCE
  • All APIs
  • Changelog
  • SDK
  • AI Assistant for Developers
  • Widgets
  • Tutorials
  • Suite Sandbox
  • Beta Program
  • Webex Status API
  • XML API Deprecation

Webex Meetings

Screen Sharing

The Webex iOS Meetings SDK allows you to share the entire screen of your Android mobile device during a call or meeting.

This article guides your through implementing screen sharing in your own Android application.

anchorStart Screen Sharing

anchor

Before continuing, ensure that the call is in a CONNECTED status and that you are not already sharing your screen in this call, otherwise, the callback throws an error.

To start sharing your screen:

activeCall.startSharing(r -> Ln.d("startSharing result: " + r));

When initiating screen sharing for the first time, Android displays an alert dialog warning the user that the entire screen will be captured. Checking Don't show again prevents this dialog from appearing in the future:

Share content warning

anchorStop Screen Sharing

anchor

The SendingSharingEvent triggers through the CallObserver.onMediaChanged() callback after successfully starting or stopping screen sharing. Use the isSending() method to check the sharing status:

activeCall.stopSharing(r -> Ln.d("stopSharing result: " + r));

anchorCheck the Status of Screen Sharing

anchor

To check if screen sharing is active:

boolean isSharing = activeCall.isSendingSharing();

anchorSet the Screen Share View

anchor

To view screen or content shared by a remote participant, create a MediaOption with the audioVideoShare function for the dial or answer method:

MediaOption option = MediaOption. audioVideoSharing(new Pair<>(localView, remoteView),shareView);

webex.phone().dial("coworker@acm.com", option, (result) -> {
            if (result.isSuccessful()) {
                call = result.getData();
                call.setObserver(callObserver);
            }
            //...
});

You can also provide a view only at the point when the other party starts sharing their screen:

MediaOption option = MediaOption. audioVideoSharing(new Pair<>(localView, remoteView),null);

webex.phone().dial("coworker@acm.com", option, (result) -> {
    if (result.isSuccessful()) {
        call = result.getData();
        call.setObserver(callObserver);
    }
    //...
});


@Override
public void onMediaChanged(MediaChangedEvent mediaChangedEvent) {
    if (mediaChangedEvent instanceof RemoteSendingSharingEvent) {
        if (((RemoteSendingSharingEvent) mediaChangedEvent).isSending()) {
            mediaChangedEvent.getCall().setSharingRenderView(shareView);
        } else if (!((RemoteSendingSharingEvent) mediaChangedEvent).isSending()) {
            mediaChangedEvent.getCall().setSharingRenderView(null);
        }
    }
}

anchorScreen Share Optimization

anchor

Screen Share Optimization methods are available to enhance the experience of sharing video and text. These API changes are available from version 3.9.0 onwards.

Optimization API Examples

The following are examples of how to use the Screen Share Optimization APIs:

  1. Screen Sharing on Android devices targeting API 28 or earlier:

    call.startSharing(CompletionHandler { result ->
        if (result.isSuccessful) {
            // startSharing successful
        } else {
            // startSharing failed
        }
    
    }, shareConfig = ShareConfig((Call.ShareOptimizeType.AutoDetection, false)))
    

    The shareConfig parameter is optional. If not set, the default optimization with a maximum of 3 fps will be used. The shareConfig parameter is available from version 3.9.0 onwards.

  2. Screen Sharing on Android devices targeting API 29 or later:

    call.startSharing(notification = buildScreenShareForegroundServiceNotification(), notificationId = 0xabc61. CompletionHandler { result ->
        if (result.isSuccessful) {
            // startSharing successful
        } else {
            // startSharing failed
        } 
    }, shareConfig = ShareConfig((Call.ShareOptimizeType.AutoDetection, false)))
    
    private fun buildScreenShareForegroundServiceNotification(): Notification {
    
        val channelId =
                if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.O) {
                    createNotificationChannel("screen_share_service_v3_sdk", "Background Screen Share Service v3 SDK")
                } else { "" }
        val notificationBuilder =
                NotificationCompat.Builder(requireContext(), channelId)
                        .setSmallIcon(R.drawable.app_notification_icon)
                        .setContentTitle(getString("ScreenShare"))
                        .setContentText(getString("You are starting screenshare"))
                        .setPriority(NotificationCompat.PRIORITY_MAX)
                        .setTicker(getString(contentId))
                        .setDefaults(Notification.DEFAULT_SOUND)
    
        return notificationBuilder.build()
    }
    

    The shareConfig parameter is optional. If not provided, the default optimization is used, and audio is not shared. This parameter has been available since version 3.9.0.

  3. To retrieve the current sharing configuration for an active call, use the call.getShareConfig() API.

    var sharingConfig = call.getShareConfig()
    

anchorSet ShareConfig

anchor

To set the share configuration, use one of the following options:

    // Default setting: no special optimization, max 3 FPS.    
    var shareConfig = ShareConfig(Call.ShareOptimizeType.Default, false)

    // Auto-detects sharing type, max 5 FPS.
    var shareConfig = ShareConfig(Call.ShareOptimizeType.AutoDetection, false)

    // Optimizes screen sharing for video/motion, max 30 FPS.
    var shareConfig = ShareConfig(Call.ShareOptimizeType.OptimizeVideo, false)

    // Optimizes video/motion sharing, max 30 FPS.
    var shareConfig = ShareConfig(Call.ShareOptimizeType.OptimizeVideo, true)

    // Optimizes text/image sharing, max 5 FPS.
    var shareConfig = ShareConfig(Call.ShareOptimizeType.OptimizeText, false)

anchorShareMaxCaptureFPS

anchor

The ShareMaxCaptureFPS method in AdvancedSetting.kt allows for setting the maximum fps during screen sharing. However, the Screenshare Optimization settings will override the ShareMaxCaptureFPS setting.

webex.phone.setAdvancedSetting(AdvancedSetting.ShareMaxCaptureFPS(fps) as AdvancedSetting<*>)

Here are some scenarios showing the interaction between ShareMaxCaptureFPS and screenshare optimization from version 3.9.0:

  • Set ShareMaxCaptureFPS to 10 and OptimizeText in ShareConfig to limit the FPS to 5.
  • Set ShareMaxCaptureFPS to 3 and OptimizeText in ShareConfig to limit the FPS to 5.
  • Set ShareMaxCaptureFPS to 10 and OptimizeVideo in ShareConfig to achieve a maximum FPS of 30.
  • Set ShareMaxCaptureFPS to 7 without using shareConfig to achieve a maximum FPS of 7.
  • Set ShareMaxCaptureFPS to 30 without using shareConfig to achieve a maximum FPS of 30.
  • Do not set ShareMaxCaptureFPS or set it to 0 without using shareConfig to limit the FPS to 5.
In This Article
  • Start Screen Sharing
  • Stop Screen Sharing
  • Check the Status of Screen Sharing
  • Set the Screen Share View
  • Screen Share Optimization
  • Set ShareConfig
  • ShareMaxCaptureFPS

Connect

Support

Developer Community

Developer Events

Contact Sales

Handy Links

Webex Ambassadors

Webex App Hub

Resources

Open Source Bot Starter Kits

Download Webex

DevNet Learning Labs

Terms of Service

Privacy Policy

Cookie Policy

Trademarks

© 2025 Cisco and/or its affiliates. All rights reserved.