All Products
Search
Document Center

Demo compilation

Last Updated: Aug 01, 2019

Environment requirements

The following table lists mandatory requirements.

Name Requirement
Android system version Android 4.3 or later
Android API version Jelly Bean (API 18) or later
CPU architecture support ARM64 and ARMv7
Integrated tool Android Studio

The following table lists optional requirements that provide reference for developers who compile and run the source code. These requirements are used in the development environment to develop the demo.

Name Requirement
Android Studio version 3.1.3
Java runtime environment (JRE) 1.8.0_152-release-1024-b01 x86_64
Java virtual machine (JVM) OpenJDK 64-Bit
compileSdkVersion 26
buildToolsVersion 26.0.2
minSdkVersion 18
targetSdkVersion 26
Gradle version gradle-4.4-all
Gradle plug-in version com.android.tools.build:gradle:3.0.1

Demo download

  • Click SDK download. On the download page, find SmartVideo for Android under SmartVideo source code download and download the source code package. The demo source code is included in the package. Download SmartVideo source code

  • The following figure shows the location and directory structure of the demo source code, where the ApsaraVideoQuVideo folder contains the demo source code of the basic SmartVideo for Android. Demo location

Directory structure

3.1 Modules

Name Description
AlivcCore The core components of the short video SDK.
AliyunCrop The module that contains the code used to implement the cropping UI.
AlivcLittleVideo The module that contains the code related to SmartVideo.
AliyunEditor The module that contains the code used to implement the editing UI.
AliyunFileDownLoader The module related to resource download and databases.
Aliyunplayer The player SDK.
AliyunRecorder The module that contains the code used to implement the recording UI.
AliyunSVideoBase The module that contains some custom views and utility classes.
AliyunSvideoMusic The module that contains the code used to implement the music UI.
AliyunVideoSdk The core editing features of the short video SDK.
AliyunVideoCommon The public module, which contains some utility classes.
thirdparty-lib The module that contains dependent third-party libraries required by the demo.

3.2 SO files

Name Description Required
libfdk-aac.so The library related to the audio codec. Yes
liblive-openh264.so The library related to the video codec. Yes
libQuCore.so The core library of the short video SDK. Yes
libsvideo_alivcffmpeg.so The dependent third-party library of the short video SDK. Yes
libFaceAREngine.so The library related to facial recognition. No (applicable only to facial recognition)
libAliFaceAREngine.so The library related to facial recognition. No (applicable only to facial recognition)

Project compilation

Step 1: Download Gradle

Click Gradle download. On the download page, download the distribution package of Gradle 4.4 required by the compilation environment to a local directory. Then, decompress the downloaded package. Download Gradle

Step 2: Import a project

Open Android Studio. On the homepage, click Open an existing Android Studio project to import the ApsaraVideoShortVideoBase project from the /demo directory of the downloaded demo. Open a project

Step 3: Configure local Gradle settings

  • Click Cancel to disable the Gradle wrapper. Cancel the Gradle wrapper

  • Select the local directory where the Gradle distribution package is decompressed in Step 1 as the directory of the local Gradle distribution. Select the local Gradle directory

Step 4: Compile and run the project

  1. In the directory AlivcLittleVideo/src/main/java/com/aliyun/apsara/alivclittlevideo/constants, open the AlivcLittleServerApiConstants.class file and set BASE_URL to the public IP address of your ECS instance.

  2. After the compilation, click Run to generate an .apk file and install it on a mobile phone that meets specified hardware requirements.

Tips: The demo can run properly on physical devices, but temporarily cannot run on virtual machines.