All Products
Search
Document Center

Project Configuration

Last Updated: Aug 19, 2019

The short video SDK supports Android 4.3 and later versions.

Development environment

Java 1.7, Android SDK API level 18, and their later versions are supported.

API reference

For more information in Chinese, see API Reference.

For more information, see API Reference.

SDK edition

The short video SDK has three editions: basic edition, standard edition, and professional edition. For more information about the differences among the editions, see Introduction.

SDK integration

Add the Alibaba Cloud Maven repository

Add the Maven repository URL to build.gradle.

  1. allprojects {
  2. repositories {
  3. maven {
  4. url 'http://maven.aliyun.com/nexus/content/repositories/releases/'
  5. }
  6. }
  7. }

Basic edition

(Recommended) Add dependencies required by the short video SDK of the basic edition to the Maven project.

  1. dependencies {
  2. implementation 'com.aliyun.video.android:svideosnap:3.10.5'// Required. The short video SDK of the basic edition.
  3. implementation 'com.aliyun.video.android:core:1.2.0' // Required. The core library.
  4. implementation 'com.alivc.conan:AlivcConan:0.9.5'// Required. The core library.
  5. implementation 'com.aliyun.video.android:AlivcSvideoFFmpeg:1.0.1'// Required. The core library.
  6. implementation 'com.aliyun.video.android:upload:1.5.2'// Optional. The upload library.
  7. }

Standard edition

(Recommended) Add dependencies required by the short video SDK of the standard edition to the Maven project.

  1. dependencies {
  2. implementation 'com.aliyun.video.android:svideostandard:3.10.5'// Required. The short video SDK of the standard edition.
  3. implementation 'com.aliyun.video.android:core:1.2.0' // Required. The core library.
  4. implementation 'com.alivc.conan:AlivcConan:0.9.5'// Required. The core library.
  5. implementation 'com.aliyun.video.android:AlivcSvideoFFmpeg:1.0.1'// Required. The core library.
  6. implementation 'com.aliyun.video.android:upload:1.5.2'// Optional. The upload library.
  7. }

Professional edition

(Recommended) Add dependencies required by the short video SDK of the professional edition to the Maven project.

  1. dependencies{
  2. implementation 'com.aliyun.video.android:svideopro:3.10.5'// Required. The short video SDK of the professional edition.
  3. implementation 'com.aliyun.video.android:core:1.2.0' // Required. The core library.
  4. implementation 'com.alivc.conan:AlivcConan:0.9.5'// Required. The core library.
  5. implementation 'com.aliyun.video.android:AlivcSvideoFFmpeg:1.0.1'// Required. The core library.
  6. implementation 'com.aliyun.video.android:upload:1.5.2'// Optional. The upload library.
  7. }

The short video SDK only supports the armeabi-v7a and arm64-v8a instruction sets. To be compatible with armeabi, we recommend that you directly copy .so files in the armeabi-v7a folder to the armeabi folder. The compatibility with ARMv5 and ARMv6 mobile phones is of little significance because Android develops rapidly and the short video SDK supports only Android 4.3 and later versions.

Integrate the SDK manually

  1. Import the AAR and JAR packages.a. Choose File > New > New Module and create an Android library as the module, as shown in the following figure. Here, AliyunSvideoLibrary is used as an example.new module

b. Copy AliyunSdk-RCE.aar, AlivcConan-0.9.4.1.aar, and AlivcCore.jar from the decompressed SDK package to the new module to add them to your project.sdk

c. Add the dependencies on the AAR and JAR packages by using Gradle.

  1. dependencies {
  2. implementation fileTree(include: ['*.jar','*.aar'], dir: 'libs')
  3. }

d. Add the dependency on the AliyunSvideoLibrary module to the app module as follows:

  1. dependencies {
  2. implementation project(":AliyunSvideoLibrary")
  3. }
  1. Import .so files.

a. Copy the jniLibs folder from the decompressed SDK package to the main folder of the app module. Then, declare the path of jniLibs in the build.gradle file of the app module as follows:

  1. android {
  2. sourceSets.main {
  3. jni.srcDirs = []
  4. jniLibs.srcDir "src/main/jniLibs"
  5. }
  6. }

b. Load the dynamic libraries required by the SDK. Currently, the libraries have been loaded inside the SDK, so manual loading is not required. The libraries are described as follows:

  1. libalivcffmpeg.so-------------The third-party library on which the SDK depends, which must be loaded.
  2. libaliresample.so-------------------The library related to audio resampling, which is optional.
  1. Add the dependencies required by the upload feature.Short video upload depends on the upload SDK and OSS. If the upload feature is not required, skip this step.
  1. implementation 'com.aliyun.video.android:upload:1.5.2'
  2. implementation 'com.google.code.gson:gson:2.8.0'
  3. implementation 'com.squareup.okhttp3:okhttp:3.2.0'
  4. implementation 'com.aliyun.dpa:oss-android-sdk:+'
  1. Initialize the configuration.Call the following method in the onCreate method of the Application class in the app module:
  1. com.aliyun.vod.common.httpfinal.QupaiHttpFinal.getInstance().initOkHttpFinal();

Required permissions

  1. <uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" />
  2. <uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE" />
  3. <uses-permission android:name="android.permission.CAMERA" />
  4. <uses-permission android:name="android.permission.FLASHLIGHT" />
  5. <uses-permission android:name="android.permission.RECORD_VIDEO" />
  6. <uses-permission android:name="android.permission.RECORD_AUDIO" />
  7. <uses-permission android:name="android.permission.INTERNET" />
  8. <uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />

Permissions need to be requested dynamically in Android 6.0 and later versions.

Obfuscation configuration

Locate the obfuscation configuration file in the app module of the demo project and copy the configuration to the obfuscation configuration file of your project.

Location of the obfuscation configuration file