All Products
Search
Document Center

Demo compilation

Last Updated: Nov 14, 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 here to go to the download page. Then, find and download the SmartVideo for Android source code package in the Download link column of the SmartVideo source code table. 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

1. Modules

Name Description
AliyunCrop The code for configuring the cropping UI.
AlivcLittleVideo The business code of SmartVideo.
AliyunEditor The code for configuring the editing UI.
AliyunFileDownLoader The code related to resource download and databases.
Aliyunplayer The player SDK.
AliyunRecorder The code for configuring the recording UI.
AliyunSVideoBase The code for customizing views and utility classes.
AliyunSvideoMusic The code for configuring the music UI.
AliyunVideoCommon The public components, which include some utility classes.
thirdparty-lib The dependent third-party libraries of the project.

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
libalivcffmpeg.so The dependent third-party libraries of the short video SDK. Yes
libAliFaceAREngine.so The library related to facial recognition. No (applicable only to facial recognition)

Project compilation

Step 1: Download Gradle

Click here to go to the Gradle download page. Then, download the distribution package of Gradle 4.4 required by the compilation environment to a local directory and 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/mian/java/com/aliyun/apsara/alivclittlevideo/constants, open the AlivcLittleServerApiConstants.class file. Set the BASE_URL variable to the public IP address of your ECS instance plus the port number 8080, that is, http://Public IP address:8080.

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

Note: The demo can run properly on a physical device, but temporarily cannot run on a virtual machine.