All Products
Search
Document Center

ApsaraVideo Live:SDK integration

Last Updated:Sep 11, 2025

This topic describes how to integrate the Push SDK for Android.

Environment requirements

Item

Description

Development tool

Android Studio is recommended.

Android version

Android 5.0 or later is required.

Step 1: Integrate the SDK

(Recommended) Integrate the SDK using Maven

  1. Add the Maven repository URL to your project's `build.gradle` file.

    maven { url "https://maven.aliyun.com/nexus/content/repositories/releases" }
  2. Add the SDK dependency to the dependencies node in your app's `build.gradle` file.

    // Basic Edition of the Push SDK
    implementation 'com.alivc.pusher:AlivcLivePusher:x.y.z'
    Note
    • x.y.z is the version number of the Push SDK. Replace `x.y.z` with the latest version number from SDK downloads, such as 7.4.0.

    • The Push SDK and the Player SDK (AliyunPlayer) cannot be integrated simultaneously. To integrate both SDKs, you must use the ApsaraVideo MediaBox SDK. For more information, see Scenarios and Integrate the ApsaraVideo MediaBox SDK.

  3. Add the CPU architectures for your app to the app's `build.gradle` file.

    defaultConfig {
     ndk {
     abiFilters "armeabi", "armeabi-v7a", "arm64-v8a"
     }
    }

Manually integrate the SDK

  1. Download and decompress the Push SDK.

  2. Copy the `*.aar` file from the SDK to the `libs` folder of your app module.

  3. In your project's `build.gradle` file, add the flatDir configuration to the repositories node of the allprojects block.

    flatDir {
     dirs 'libs'
    }
  4. Add a reference to the AAR file in the dependencies node of your app's `build.gradle` file.

    dependencies {
     implementation fileTree(dir: 'libs', include the following: ['*.aar'])
    }

Step 2: Configure the license

For instructions, see the License Integration Guide.

Step 3: Configure app permissions

Configure the required permissions in your app's `src/main/AndroidManifest.xml` file.

<!--  Used for network features  -->
<uses-permission android:name="android.permission.INTERNET" />
<!--  To check the network connection state of the device, you'll need to add the ACCESS_NETWORK_STATE permission.  -->
<!--  This permission does not require user consent at runtime, but needs to be declared in the app's AndroidManifest.xml.  -->
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />

<!--  If the app needs to record audio, you need to declare the RECORD_AUDIO permission and request this permission at runtime  -->
<uses-permission android:name="android.permission.RECORD_AUDIO" />
<uses-permission android:name="android.permission.MODIFY_AUDIO_SETTINGS" />

<!--  The application needs to access the device's camera  -->
<uses-permission android:name="android.permission.CAMERA" />

<!-- Request legacy Bluetooth permissions on older devices. -->
<uses-permission
  android:name="android.permission.BLUETOOTH"
  android:maxSdkVersion="30" />
<uses-permission
  android:name="android.permission.BLUETOOTH_ADMIN"
  android:maxSdkVersion="30" />
<!-- Needed only if your app communicates with already-paired Bluetooth devices. -->
<uses-permission android:name="android.permission.BLUETOOTH_CONNECT" />

<!-- Only used by Demo for accessing storage files  -->
<!--  Storage permissions  -->
<uses-permission
  android:name="android.permission.READ_EXTERNAL_STORAGE"
  android:maxSdkVersion="32" />
<!-- Access image files -->
<uses-permission
  android:name="android.permission.READ_MEDIA_IMAGES"
  android:minSdkVersion="33" />
<!-- Write audio files -->
<uses-permission
  android:name="android.permission.READ_MEDIA_AUDIO"
  android:minSdkVersion="33" />
<!-- Write video files -->
<uses-permission
  android:name="android.permission.READ_MEDIA_VIDEO"
  android:minSdkVersion="33" />

<!-- Only used by Demo for screen recording and streaming  -->
<!-- Used for creating background tasks, not required by SDK -->
<uses-permission android:name="android.permission.FOREGROUND_SERVICE" />
<!-- Requesting permission to create system overlay windows -->
<uses-permission android:name="android.permission.SYSTEM_ALERT_WINDOW" />

<!-- Only used by Demo for muting  -->
<!-- If this permission is not declared, the feature of automatically muting the stream during a phone call will not work -->
<uses-permission android:name="android.permission.READ_PHONE_STATE" />

Step 4: Configure obfuscation rules

Add the obfuscation rules to your app's `proguard-rules.pro` file.

-keep class org.webrtc.** { *; }
-keep class com.alivc.** { *; }
-keep class com.aliyun.** { *; }
-keep class com.cicada.** { *; }

Usage notes