Enabling Interactive Broadcast¶
This page demonstrates the following interactive broadcast functions with the Agora sample code Open Live on Android:
- Create/Join a channel
- Enable a voice or video live broadcast
- Set the video resolution
- Switch the camera
Step 1: Download the Sample Code¶
Download the latest Full SDK.
|./libs||The required libraries|
|./samples||Open Live Sample Code|
Step 2: Prepare the Environments¶
Prepare the following environments:
- Android SDK API 16 or later
- Android Studio 2.0 or later
- Android 4.1 or later devices with audio and video functionalities
- Get an App ID
Step 3: Enable a Live Broadcast¶
Agora.io provides sample code called Open Live.
Compile the Sample Code¶
- Select Import project (Eclipse ADT, Gradle, etc.) in Android Studio.
- Import OpenLive_Android/build.gradle using the import function of Android Studio.
- Enter your App ID in OpenLive_Android/app/src/main/res/values/strings_config.xml. For example,
- Click Run to compile the sample code with Android devices connected.
Run the Sample Code¶
You need two Android devices to run the sample code.
Open the Open Live application on the Android device, and the following screen appears:
Enter a channel name in Input Name of Live.
Click the Settings icon on the top right to select the resolution.
Set the user mode.