This page contains information on how to prepare the development environment before enabling a voice call with the Agora Voice SDK.


Development environment:

  • A device with audio support running Android 4.1 or later.
  • Android SDK for API level 16 or later.
  • Android Studio 3.0 or later.
  • Before accessing Agora’s services, ensure that you open the ports and whitelist the domains specified in Firewall Requirements.
  • If you want to run your app on Android 9, see Android Privacy Changes for more information.

Download the Agora SDK:

The Agora Voice SDK for Android.

Downloaded files include the libs folder and the sample folder. The following table lists the contents of the libs folder.

File/Folder Name File Type
agora-rtc-sdk.jar Java JAR file
arm64-v8a folder
armeabi-v7a folder
include folder
x86 folder

Before integrating the SDK into your project, you can try to integrate the SDK into the sample first.

Add the Agora SDK to Your Project

  1. Set the storage directory of the libs folder. Open your project in Android Studio (this article takes the sample as an example), select the app/src/main/build.gradle file, and add the preset storage directory to the fileTree code line.

Ensure that the path name contains no Chinese characters. If the path contains Chinese characters, compiling the code fails and displays an error message that contains random ASCII characters.

  1. Add the libs folder according to the storage directory preset in step 1.

  2. Add sourceSets. In the build.gradle file, set the same storage directory as the libs folder.

     android {
      sourceSets {
             main {
                 jniLibs.srcDirs = ['../../../libs']
  3. Add the App ID in the app/src/main/res/values/strings.xml file.

        <string name="app_name">Agora-Android-Voice-Tutorial</string>
        <string name="agora_app_id">YOUR APP ID</string>
  4. Click Sync Project With Gradle Files until the synchronization is complete.

Configure the Android NDK

To call the plug-ins in the include files under the libs folder, you need to configure the Android NDK:

  1. Click the Configure button and select Project Defaults > Project Structure. Click to download the Android NDK.

  2. Click Finish when the download is complete and Android Studio automatically adds the NDK path.

    If the path is not automatically added, add it manually and check it in the file.

  3. Re-synchronize the Android project by clicking Sync Project With Gradle Files.

Add the Device Permissions

  1. Open the app/src/main/AndroidManifest.xml file and add the required device permissions to the file.

    <manifest xmlns:android=""
    <uses-permission android:name="android.permission.READ_PHONE_STATE" />    
    <uses-permission android:name="android.permission.INTERNET" />
    <uses-permission android:name="android.permission.RECORD_AUDIO" />
    <uses-permission android:name="android.permission.CAMERA" />
    <uses-permission android:name="android.permission.MODIFY_AUDIO_SETTINGS" />
    <uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />
    <!-- The Agora SDK requires Bluetooth permissions in case users are using Bluetooth devices.-->
    <uses-permission android:name="android.permission.BLUETOOTH" />
     <uses-permission android:name="android.permission.ACCESS_WIFI_STATE" />
  2. Re-synchronize the Android project by clicking Sync Project With Gradle Files.

Prevent Obfuscation of the Agora Classes

In the file, add a -keep class configuration for the Agora SDK. This prevents obfuscation of the Agora SDK public class names.

-keep class io.agora.**{*;}

Next Steps

You have set up the Android environment and can start a call/live broadcast following the steps under Quickstart Guide:

  • Initialize the SDK
  • Join a Channel
  • Publish and Subscribe to Streams