The Android SDK is a development tool that connects Android clients to the AgentBay smart sandbox. You can integrate the SDK to quickly build and customize Android clients for AgentBay.
1 Quick start
1.1 Obtain the SDK and demo
Methods
Download AndroidSDK_aar.
Download AndroidSDK_demo.
All platform resources, including documents, SDKs, and client programs, are strictly for your or your organization's internal use. Unauthorized sharing with third parties or other organizations is prohibited without prior written consent from Alibaba Cloud.
Environment requirements
Android version: Android 5.1 or later
Integrate the SDK by using an AAR package
Copy the downloaded aspengine-third-release.aar, aspengine-player-release.aar, and wytrace-release.aar to the app/libs directory.
Add a library to the build.gradle file of the application module.
dependencies {
implementation fileTree(include: ['*.jar', '*.aar'], dir: 'libs')
// INI configuration parsing library for aspengine-sdk
implementation 'org.ini4j:ini4j:0.5.4'
// Dependency for wytrace
implementation 'com.squareup.okhttp3:okhttp:5.0.0-alpha.8'
implementation 'com.google.code.gson:gson:2.10.1'
implementation 'io.github.aliyun-sls:aliyun-log-android-sdk:2.7.0@aar'
}Declare required permissions in the AndroidManifest file.
<uses-permission android:name="android.permission.INTERNET" />
<uses-permission android:name="android.permission.VIBRATE"/>1.2 Integration process
1.3 Best practices
Refer to Best practices for integrating Cloud Phone for implementation details. The following figure outlines the cloud phone integration process.
Multiple logon methods are supported to retrieve the ticket credential for cloud phone access, which is required for SDK integration. Refer to the following flowcharts:
See the "Lifecycle interfaces" section for sample integration code.