All Products
Document Center

Apsara Video SDK:Integrate Queen SDK for Android

Last Updated:Mar 22, 2024

Queen SDK is a smart retouching SDK developed by the video cloud team of Alibaba. This SDK provides a wide range of features including image retouching, face retouching, chroma key, stickers, makeup, gesture recognition, body shaping, hairdressing, and augmented reality (AR) writing. You can use these features in live streaming, video conferencing, and short video production scenarios. This topic describes how to integrate Queen SDK for Android to help you implement retouching features.


A development environment is set up. The following table describes the requirements for the development environment.




Android 4.3 or later.


Java 1.7 or later.


Android API level 18 or later.

Android Studio

Android Studio 2.3 or later. To download Android Studio, visit Android Studio.

Integrate the SDK by using Maven dependencies

  1. Add the Alibaba Cloud Maven repository to the build.gradle file of your project.

    allprojects {
     repositories {
     maven { url "" }
  2. Add Queen SDK dependencies to the build.gradle file of your application.

    // The Queen SDK package.
    implementation ""
    // Optional. The menu component of Queen SDK.
    implementation "" // Download the menu resources.
    implementation "" // Package the menu resources on your on-premises machine.

The libraries of retouching features and the libraries of Alibaba Cloud SDKs such as Alibaba Cloud Real-Time Communication (RTC) SDK may contain duplicate files. As a result, your application may fail to be packaged. In this case, add the packagingOptions parameter to the build.gradle file of your project to avoid file conflicts, as shown in the following code. If no duplicate files exist, you do not need to add this parameter.

android { 
 compileSdkVersion ... 
 packagingOptions {
 pickFirst '**/' // If duplicate files exist, add this line of code.
 pickFirst '**/' // If duplicate files exist, add this line of code.
 pickFirst '**/' // If duplicate files exist, add this line of code.

Integrate the SDK by importing .aar files

  1. Download the Queen SDK package and decompress the package.

  2. Copy the .aar files extracted from the SDK package to the libs folder of your project.

Configure the license

Make sure that you have obtained a license for Queen SDK in advance. For more information, see Obtain a license of Queen SDK. After you obtain a license, perform the following operations to configure the license key and license file in your project:

  • If you integrate Queen SDK of ApsaraVideo Live and the short video SDK of ApsaraVideo VOD at the same time, the two SDKs use the same license key and license file. You need to configure the license only once. Take note that the latest license file must be used.

  • If the SDK that you purchase is updated or needs to be renewed, you must also update the license. Perform the following steps to update the license:

    1. Obtain the latest license. For more information, see Obtain a license of Queen SDK.

    2. After you obtain the latest license, configure the license again.

Import the license to the assets folder of your project, and then add two meta-data entries under the application node in the AndroidManifest.xml file. The following sample code provides an example:

com.aliyun.alivc_license.licensekey is the metadata entry that specifies the license key.

 android:label="@string/app_name" >
 android:value="Your LicenseKey"/> // Enter the license key that you obtain.
 android:value="Your LicenseFile Path"/> // Enter the path of the license file relative to the assets folder. Example: alivc_license/AliVideoCert.crt.




Sample project

Sample project

In the sample project, the assets folder contains all the image resources of the demo.

Demo project on GitHub

Demo project

The demo project provides integration examples of the following SDKs: Alibaba Cloud Push SDK, Qiniu Cloud Live Video Cloud SDK, and Tencent Real-Time Communication SDK.

Quick start

Quick start package

The quick start package improves the efficiency of integrating Queen SDK. You can use the latest version of the quick start package to integrate the latest version of Queen SDK. The quick start package also provides guidance to help you troubleshoot common issues.

Code for integration with SDKs from common vendors