This topic describes how to build the short video client for Android.

Prerequisites

The following table describes the environment requirements for development.

Category Description
System version Android 4.3 or later is supported.
API version API 18 or later is supported.
CPU architecture The ARM64 and ARMv7 architectures are supported for physical devices. Simulator architectures are not supported.
Android Studio version Android Studio 3.1 or later is supported. Download Android Studio.

You must build and start the short video AppServer first. For more information, see Build the short video AppServer.

Procedure

  1. Download the short video demo and decompress the package. For more information about how to download the demo file for the short video client for Android, see SDK download.
    Directory structure:
    - demo  
      - ApsaraVideoQuVideo
          - |- AlivcLittleVideo     # The module that contains the code related to the short video service.
          - |- AliyunCrop           # The module that contains the code used to implement the cropping UI.
          - |- AliyunEditor         # The module that contains the code used to implement the editing UI.
          - |- AliyunFileDownLoader # The module that is related to resource download and databases.
          - |- 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.
          - |- AliyunVideoCommon    # The public module that contains some utility classes.     
          - |- thirdparty-lib       # The module that contains dependent third-party libraries required by the demo.
    - SDK  # The SDK that is used by the project. You can manually import an SDK as needed.
    - xxxReleaseNote.md  # The release note.
  2. Import and configure the project.
    1. Open Android Studio, click Open an existing Android Studio project, and then select the ./demo/ApsaraVideoQuVideo folder in the root directory of the client source code for Android.
      File directory
    2. Specify the server address.

      File path: AlivcLittleVideo/src/mian/java/com/aliyun/apsara/alivclittlevideo/constantsAlivcLittleServerApiConstants.java.

      After you build the short video AppServer on an Elastic Compute Service (ECS) instance, set the BASE_URL variable in the file to the public IP address of the ECS instance followed by the port number 8080.

      Example: http://<Public IP address of the ECS instance>:8080.

      Modify the file
  3. Compile and run the project.
    1. Connect an Android physical device to your computer by using a data cable. You must enable the developer mode and USB debugging feature in the system settings on the physical device. After you agree to debug the physical device, select the physical device in Android Studio.
    2. Click build and run. The short video application is installed and started on the Android physical device.
    Compile