This topic describes how to compile the demo of Push SDK for Android.
Download the demo
For information about how to download the demo source code and installation package of the latest version of Push SDK, see SDK download and release notes.
Demo compilation
Environment requirements
The following table describes the mandatory requirements for the runtime environment.
Item
Requirement
OS version
Android 5.0 or later
Android API version
API level 21 or later
CPU architecture
ARM64 or ARMv7
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.
Item
Requirement
Android Studio version
4.1.3
Java Runtime Environment (JRE)
1.8.0_152-release-1136-b06 amd64
Java Virtual Machine (JVM)
OpenJDK 64-Bit
compileSdkVersion
31
buildToolsVersion
30.0.3
minSdkVersion
21
targetSdkVersion
31
Gradle version
gradle-7.0.2-bin
Gradle plugin version
com.android.tools.build:gradle:4.1.2
NDK plugin version
No requirement (default: android-ndk-r18b)
Run the demo source code
Download the demo package of the required version by using the download link provided in the SDK download and release notes topic.
Open Android Studio. Click Open an Existing Project and import the demo project to Android Studio.
After the demo is compiled, click Run to install the demo on your Android device.
Experience the features provided in the demo.
Item
Details
Homepage of the mobile app for stream ingest
Stream ingest settings
Tap Camera Pushing to configure the stream ingest settings, as shown in the following figures.
Stream Ingest Parameters: Turn on Bitrate Control and Advanced Settings, and set DisplayMode to Quality First. Configure other parameters based on your business requirements.
Stream Ingest Features: Set Ingest to to Portrait and Orientation to aspectFill.
Stream ingest and retouching
Enter the ingest URL, and you can start stream ingest.
Tap the Retouching button to display the retouching panel and configure retouching settings.
Tap Start pushing to start ingesting audio and video streams.
NoteYou must enter 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.
Stream ingest for screen recording
Co-streaming and battle
Directory structure of the demo of Push SDK for Android
The following figure shows the directory structure of the demo:
LiveAPP is the application module and is the entrance to the demo.
Different features are placed in different sub-modules, inlcuding LiveBasic (basic streaming), LiveBeauty (retouching), and LiveInteractive (interactive streaming).