Enabling Interactive Broadcast

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
  • Mute/unmute

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

  1. Select Import project (Eclipse ADT, Gradle, etc.) in Android Studio.
  2. Import OpenLive_Android/build.gradle using the import function of Android Studio.
  1. Enter your App ID in OpenLive_Android/app/src/main/res/values/strings_config.xml. For example,
  1. 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.

  1. Open the Open Live application on the Android device, and the following screen appears:

  2. Enter a channel name in Input Name of Live.

  3. Click the Settings icon on the top right to select the resolution.

  4. Set the user mode.

    • Join the channel as a host by clicking JOIN ROOM and selecting BROADCASTER.

    • Join the channel as an audience by clicking JOIN ROOM and selecting AUDIENCE.