Skip to main content
The Ant Media Server Android SDK enables ultra-low latency WebRTC streaming in native Android applications. Built with Java/Kotlin compatibility and optimized for mobile performance.

Installation

Gradle

Add the dependency to your app’s build.gradle:

Maven Repository

Add the Ant Media Maven repository to your project’s build.gradle:

Permissions

Add required permissions to your AndroidManifest.xml:

Basic Usage

Initialize the SDK

Publishing a Stream

Publish video from the device camera:

Playing a Stream

Play an existing stream:

Video Rendering

Add SurfaceViewRenderer to your layout:
Set video renderers in code:

Conference Room

Join a multi-party conference room:

Camera Controls

Switch between cameras and control video:

Configuration Options

Video Resolution

Set custom video resolution:

Data Channels

Send real-time data:

WebRTC Listener Events

Implement all listener methods:

Runtime Permissions

Request camera and microphone permissions:

Resources

Android SDK Repository

View source code, sample apps, and contribute on GitHub

Requirements

  • Android 5.0 (API level 21) or higher
  • Camera and microphone hardware
  • Internet connection
  • Ant Media Server with SSL/TLS configured
For production apps, make sure to handle runtime permissions properly and test on multiple Android versions and devices.

Next Steps

iOS SDK

Build for iOS with the native iOS SDK

Authentication

Secure streams with token authentication