Voice Call
  • iOS
  • Android : Java
  • macOS
  • Windows
  • Linux
  • Web
  • WeChat Mini Program
  • Flutter
  • Electron
  • Unity3D
  • uni-app
  • React Native
  • Cocos2D
  • Introduction
  • Sample codes
  • Client SDKs
    • SDK downloads
    • Release notes
  • Getting started
    • Integrate the SDK
    • Implement a basic voice call
    • Use Tokens for authentication
  • Guides
    • Common audio config
    • Real-time messaging
    • Enhancing call quailty
    • Stream mixing
    • Playing media files
    • Playing Streams via URL
    • Voice Change/Reverb/Stereo
    • Local media recording
    • Advanced features
    • Quotas and Limits
  • Error codes
  • Server APIs
  • API Documents
  • FAQ

Integrate the SDK

Last updated:2022-09-16 18:33

Set up the Development Environment

  • Android Studio 2.1 or higher.
  • Android SDK Packages: Android SDK 25, Android SDK Build-Tools 25.0.2, Android SDK Platform-Tools 25.
  • An Android Device running on Android 4.4 or higher version with a camera and microphone. You can choose to run your project on an Android emulator, but using a real device is recommended.
  • The Android device and your computer are connected to the Internet.

Integrate the SDK into Your Project

Choose either of the following methods to integrate the ZEGO Express SDK into your project.

The Android ABIs currently supported by the SDK: armeabi-v7a, arm64-v8a, x86, x86_64.

Method 1: Integrate the SDK Automatically with JCenter

  1. Add the following line to your app/build.gradle file:

    dependencies {
        // please specify the SDK version number (e.g. 1.11.0)
        // The latest version number can be found in the SDK release history
        implementation 'im.zego:express-audio:x.y.z'
  • JCenter will stop uploading the new version of the SDK after 2021-03-31, the service will be disabled 2021-05-01, please refer to Service End for JCenter .
  • Starting from the 1.11.0 version, the dependent command has been changed from implementation'im.zego:express-engine-audio:xyz' to implementation'im.zego:express-audio:xyz' . The use of the version under 1.11.0 will not be affected, but the follow-up will not be updated from "express-engine-audio". It is recommended that all developers using the old version switch to 1.11.0 or above Version for integration.

Method 2: Download and Copy the SDK Files Manually

  1. Download the ZEGO Express Android SDK and unzip the downloaded SDK package.

  2. Copy the unzipped .jar file and all the folders containing the .so files to your project directory (e.g. app/libs).

  3. Add SDK Import Statements. Open the file app/build.gradle, and add the following contents:

  • Add the ndk node inside the defaultConfig node to specify the supported ABIs.
ndk {
    abiFilters 'armeabi-v7a', 'arm64-v8a', 'x86', x86_64
  • Add the sourceSets node inside the android node to specify the directory containing the SDK files.

The "libs" directory in the sample code is just an example, developers can fill in according to the actual path.

sourceSets {
    main {
        jniLibs.srcDirs = ['libs']


  • Add the following code in the dependencies node.
implementation fileTree(dir: 'libs', include: ['*.jar'])


Set up Permissions

Open the file app/src/main/AndroidManifest.xml, and add the following code:

<!-- Permissions required by the SDK -->
    <uses-permission android:name="android.permission.ACCESS_WIFI_STATE" />
    <uses-permission android:name="android.permission.RECORD_AUDIO" />
    <uses-permission android:name="android.permission.INTERNET" />
    <uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />
    <uses-permission android:name="android.permission.BLUETOOTH" />
    <uses-permission android:name="android.permission.MODIFY_AUDIO_SETTINGS" />

    <!-- Permissons required by the App -->
    <uses-permission android:name="android.permission.READ_PHONE_STATE" />
    <uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" />
    <uses-permission android:name="android.permission.WAKE_LOCK" />

        android:required="true" />

    <uses-feature android:name="android.hardware.camera" />
    <uses-feature android:name="android.hardware.camera.autofocus" />

Note: For Android 6.0 or higher, some important permissions must be requested at runtime rather than declared statically in the file AndroidMainfest.xml , therefore you also need to add the following code to do so (requestPermissions is a method of an Android Activity).

String[] permissionNeeded = {

    if (ContextCompat.checkSelfPermission(this, "android.permission.RECORD_AUDIO") != PackageManager.PERMISSION_GRANTED) {
        requestPermissions(permissionNeeded, 101);

Prevent Class Name Obfuscation

To prevent the Zego SDK public class names from being obfuscated, please add the following code in the file proguard-rules.pro.

-keep class **.zego.**{*;}