Communication Integration - Android¶
Step 1: Obtain the SDK¶
- Voice Package
- Full Package
Each package has libs and samples folders, while samples is used in Communication Quickstart - Android.
Step 2: Prepare the Environments¶
Be sure that the following development environments are satisfied:
- Android SDK API Level> = 16
- Android Studio 2.0 or later
- Real Android devices with audio and video functionality
- Apps require Android 4.1 and above devices
Copy the following libraries from the libs folder included in the package downloaded in Step 1: Obtain the SDK according to your actual needs.
- agora-rtc-sdk.jar (mandatory)
When you copy the libraries to the libs folder in the targeted path, and if there is any Chinese character in the path, the sample code won’t be compiled successfully, and it will display ASCII code in the error message.
Put the above required libraries, for example, jar file and so file in the correct libs path according to the settings in the build.gradle file, for example,
Specify the directory of the so file in the build.gradle file as the path of the libs folder in the above step.
Import the AAR package.
This step is only applicable to the users who want to integrate the image enhancement function in Agora Native SDK.
Download the latest Image Enhancement package from http://www.agora.io/downloads/.
Select File > Project Structure… in the Android Studio.
Configure the NDK if the following error displays:
The following permissions are required in the AndroidManifest.xml file for your application when deployed:
- <uses-permission android:name=”android.permission.INTERNET” />
- <uses-permission android:name=”android.permission.RECORD_AUDIO” />
- <uses-permission android:name=”android.permission.CAMERA” />
- <uses-permission android:name=”android.permission.MODIFY_AUDIO_SETTINGS” />
- <uses-permission android:name=”android.permission.ACCESS_NETWORK_STATE” />
Click Sync Project With Gradle Files until the sync is complete.
When you write the obfuscated code, be sure that you add the following code.