Skip to main content
The Red5 Android SDK enables native Android applications to publish and subscribe to live streams over WebRTC with sub-second latency. Built on the WHIP/WHEP protocol stack, the SDK handles ICE negotiation, camera and microphone capture, and license validation. It works with both Red5 Cloud (Stream Manager) deployments and standalone Red5 Pro servers, and supports conferencing, PubNub chat, real-time stats collection, and Picture-in-Picture mode.

Requirements

  • A valid Red5 Pro SDK license key
  • Camera and microphone permissions for publishing
  • Internet permission for both publishing and subscribing
  • Android API level compatible with the WebRTC dependency

Installation

Download the Android Archive (.aar) from red5-cloud-sdk.cachefly.net and place it in your app/libs folder. Add the following dependencies to your app’s build.gradle:

Permissions

Add the following to your AndroidManifest.xml:

Minimal publish

1

Add a Red5Renderer to your layout

Red5Renderer extends WebRTC’s SurfaceViewRenderer and displays the local camera preview.
In your Activity:
2

Request camera and microphone permissions

3

Build the client

Use IRed5WebrtcClient.builder() and chain your configuration. Use setStreamManagerHost() for Red5 Cloud or setServerIp() for a standalone server.
4

Start preview after license validates

5

Publish

Minimal subscribe

Camera controls

Call these methods on the IRed5WebrtcClient instance at any time after the client is built.

Picture-in-Picture mode

The SDK supports Android’s native PiP mode for both publishing and subscribing. Auto-enter PiP when the user navigates away:
Manually enter PiP:

Real-time stats collection

Enable the stats collector to receive WebRTC metrics every 2 seconds (configurable).
Implement onRtcStats() in your Red5EventListener:

Conferencing

The SDK provides multi-party conferencing via Red5 Cloud.
Conferencing requires a Red5 Cloud (Stream Manager) deployment. It does not work with standalone servers.
1

Set a ConferenceListener and build the client

2

Join the room

3

Leave the room

Chat integration

The SDK includes built-in PubNub chat. Pass your PubNub keys when building the client:
Subscribe to a channel and send messages:
Receive messages in your Red5EventListener:

Event reference

Implement IRed5WebrtcClient.Red5EventListener in your Activity or Fragment.

Configuration reference

Key IRed5WebrtcClient.builder() methods: For the complete API reference including all methods, enums, and data models, see the Android SDK API reference.