Stream Channels are based on the room model. In a stream channel, users join a topic in order to send message to all users subscribed to that topic. Signaling enables each user to join up to one hundred channels at the same time. Each channel can have unlimited topics and up to 128 simultaneous users. Topics have a higher message transmission rate, greater message concurrency capability, and enable synchronous transmission of audio and video data. You use topics for Metaverse, AR/VR, interactive games, real-time collaboration, and parallel manipulation app.
For information about message channels where users communicate using a pub-sub model, see the Message channel quickstart.
The following figure shows the stream channel workflow:
In order to follow this procedure you must:
- Android Studio 4.1 or higher.
- Android SDK API Level 24 or higher.
- A mobile device that runs Android 4.1 or higher.
A computer with Internet access.
Ensure that no firewall is blocking your network communication.
- Raise a support ticket to activate Signaling. In your ticket, please provide the following details:
- Your Agora Customer Id
- The project VID for which you want Signaling enabled
- The App Id for the project in which you want to integrate Signaling
- Do you require Stream Channel activation: Yes or No
- Do you need data storage (Storing user and channel attributes as metadata): Yes or No
- Your geographical region for product activation: US, EU, APAC (excluding China), or China
The Agora support team confirms activation through a ticket update.
- Signaling 2.x is an enhanced version compared to 1.x with a wide range of new features. It follows a new pricing structure. Please visit the Pricing page for details.
- The beta version of Signaling 2.x is offered free of charge for testing its features and performance for the duration of its public beta.
Agora supplies a single GitHub reference repository. This runnable and testable repo contains all the code used in this Signaling SDK documentation. To create a Signaling SDK development environment:
Clone the Signaling SDK reference app to
<samples-root>on your development environment:
Navigate to your
<samples-root>folder and run the following command:
Open the reference app in Android Studio:
From the File menu select Open... then navigate to
<samples-root>/video-sdk-samples-android/android-reference-appand click OK. Android Studio loads the project and Gradle sync downloads the dependencies.
This section shows how to use the Signaling SDK to implement stream channels and presence in your app.
Keep track of the users who join and leave topics, and events in the topic. In this implementation, we use the event listener we implemented in the SDK quickstart.
To create a new stream channel, call
createStreamChannel. When you join the channel, you configure the features you will use.
A topic is a data stream management mechanism in stream channels. Users join, leave, subscribe, and unsubscribe to topics. You join a topic to publish and receive messages sent to all users in the topic. You subscribe to listen to messages sent by publishers only. When a user joins or leaves a topic, Signaling triggers an topic event notification. Users in the channel receive the notifications in real time. You use topic events to track changes in topic status. To join a topic:
There is no limit to the number of subscribers and publishers in each topic. However, there are limitations to the number of topics and messages a user can subscribe to.
Messages are transmitted through the topic. After your user has joined a topic in a channel, you publish messages to the topic. Publishers and subscribers receive the messages. To send a message:
To receive messages published to a topic, you subscribe to the topic. To subscribe:
To test the stream channel functionality:
Configure the project
Open the file
appIdto the AppID of your project.
Choose one of the following authentication methods:
- Temporary token:
- Authentication server:
- Setup an Authentication server
channelNameto the name of a channel you want to join.
rtcTokento empty strings.
serverUrlto the base URL for your token server. For example:
Run the reference app
- In Android Studio, connect a physical Android device to your development machine.
- Click Run to start the app.
- A moment later you see the project installed on your device.
Test stream channels:
- For each user, open a new instance of the reference app.
- Choose the Stream Channels example.
- Log in to Signaling, then send and receive messages using topics in channels.
This section contains information that completes the information in this page, or points you to documentation that explains other aspects to this product.