Communication Quickstart - Android

Step 1: Download the Sample Code

Click downloads to download the latest SDK and follow this document to compile and execute the sample code.

Agora Native SDK for Android has two packages:

Package Structure
Voice Package

The package structure is listed as follows:

./libs: including the required libraries

./samples: including the sample codes

  • Communication: Agora-Android-Voice-Tutorial-1to1
  • Live Broadcast: Not Available
Full Package(including both Voice and Video)

The package structure is listed as follows:

./libs: including the required libraries

./samples: including the sample codes

  • Communication: Agora-Android-Tutorial-1to1
  • Live Broadcast: Open Live

Step 2: Prepare the Environment

Be sure that the following development environments are satisfied:

  • Android SDK API Level> = 16
  • Android Studio 2.0 or later
  • Real Android devices with audio and video functionality
  • Apps require Android 4.1 and above devices
  • Prepare an App ID according to Obtaining an App ID

Step 3: Demonstrate Voice Call

Demonstrate the voice call with Agora-Android-Voice-Tutorial-1to1 sample code in the Android Voice package.

Compile the Sample Code

  1. Select Import project (Eclipse ADT, Gradle, etc.) in the Android Studio.
  2. Import build.gradle using the import function of Android Studio.
../../_images/android-demo-voice-2.png
  1. Enter your App ID in Agora-Android-Voice-Tutorial-1to1/app/res/values/src/strings.xml.
../../_images/android-demo-voice-3.png
  1. Click the Run button to compile the sample code with a real Android device connected.

Run the Sample Code

You need two phone devices to run the sample code for an audio call. Click the generated App on each Android devices, and the following screen displays:

../../_images/android-demo-voice-4.png

You can press the buttons on the screen to mute/unmute yourself or enable the speaker and etc.

Step 4: Demonstrate Video Call

Demonstrate the video call with the Agora-Android-Tutorial-1to1 sample code in the Android Voice package.

Compile the Sample Code

  1. Select Import project (Eclipse ADT, Gradle, etc.) in the Android Studio.
  2. Import build.gradle using the import function of Android Studio.
../../_images/android-demo-video-1.png
  1. Enter your App ID in Agora-Android-Tutorial-1to1/app/res/values/src/strings.xml.
../../_images/android-demo-video-2.png
  1. Click the Run button to compile the sample code with a real Android device connected.

Run the Sample Code

You need two phone devices to run the sample code for voice and video calls. Click the generated App on each Android device, and the following screen displays:

../../_images/android-demo-video-3.png

You can press the buttons on the screen to switch to audio communication, mute, switch camera and etc.