This topic describes the requirements for the runtime environment of the Push SDK demo for Android. This topic also describes how to compile the demo and provides the directory structure of the demo.

Environment requirements

  • The following table describes the mandatory requirements for the runtime environment.
    Item Requirement
    Android version Android 5.0 or later.
    Android API version API 21 or later.
    CPU architecture ARM64 or ARMv7.
    Integration tool We recommend that you use Android Studio. To download Android Studio, visit the Android Studio page.
  • The following table describes the optional requirements for the runtime environment. The demo is based on the environment information described in the table. The environment information is provided for your reference.
    Environment Requirement
    Android Studio V4.1.3
    Java runtime environment (JRE) 1.8.0_152-release-1136-b06 amd64
    Java virtual machine (JVM) OpenJDK 64-Bit
    compileSdkVersion 30
    buildToolsVersion 30.0.3
    minSdkVersion 18
    targetSdkVersion 30
    Gradle version gradle-5.6.4-all
    Gradle plugin version com.android.tools.build:gradle:3.6.2

Run the demo

  1. Download the demo package of the required version by using the download link provided in the SDK download and release notes topic.
  2. Open Android Studio, click Open an Existing Project, and then select the AlivcLivePusherDemo project in the directory of the demo to import the project to Android Studio.
  3. After the demo is compiled, click Run to install the demo on an Android device.
  4. Experience the features provided in the demo.
    • Homepage of the mobile app for stream ingestHomepage of the mobile app for stream ingest
    • Stream ingest settings
      Tap Camera capture to configure the stream ingest settings, as shown in the following figure.
      • Stream Ingest Parameters: Turn on Auto Bitrate and Advanced Settings. Set Quality Mode to Quality First. Set the rest of the parameters based on actual needs.
      • Stream Ingest Features: Set Ingest To to Portrait. Set Orientation to aspectFill. Set the rest of the parameters based on actual needs.

      Stream ingest settings - Parameter settings Stream ingest settings - Feature settings

    • Stream ingest and retouching
      Enter the ingest URL and tap Enter. The retouching feature is available during stream ingest, as shown in the following figure.Stream ingest and retouching
    • Stream ingest for screen recording
      Screen recording 1 Screen recording 2 Screen recording 3

You must specify a valid Real-Time Messaging Protocol (RTMP) URL to start stream ingest. After the stream is ingested, you can use ApsaraVideo Player SDK, FFPlay, or VLC to play the stream.

Directory structure of the demo for Android

  • Directory structure of the demo V4.1.0 and aboveDirectory structure of the demo V4.2.0
    The main folder contains the following files or subfolders:
    • AndroidManifest.xml: the configuration file of the demo for Android.
    • assets: the folder where the resource files reside.
    • java: the folder where the demo code resides.
      The following figure shows the directory structure of the java folder. java directory structure - demo V4.1.0
    • libs: the folder where the dependent JAR packages reside.
    • res: the folder where the resource files and layout files reside.
  • Directory structure of the demo V3.6.1
    The main folder contains the following files or subfolders:
    • aarLibs: the folder where the dependent AAR packages reside.
    • AndroidManifest.xml: the configuration file of the demo for Android.
    • assets: the folder where the resource files reside.
    • java: the folder where the demo code resides.
    • jniLibs: the folder where the dependent SO libraries reside.
    • libs: the folder where the dependent JAR packages reside.
    • res: the folder where the resource files and layout files reside.