logo
In-app Chat
SDK Error Codes
Powered Byspreading
On this page

Integrate the ZIM Audio SDK

This topic describes how to integrate the ZIM Audio SDK.

Prerequisites

Before you integrate the ZIM Audio SDK, make sure that the following conditions are met:

  • Development environment:
    • Android Studio 2020.3.1 or later is installed.
    • Android SDK 25, Android SDK Build-Tools 25.0.2, Android SDK Platform-Tools 25.x.x or later is installed. -Android 4.4 devices with voice functionality support.

Import the ZIM Audio SDK

The currently supported platform architectures include: armeabi-v7a, arm64-v8a, x86, and x86_64.

You can integrate the SDK through any of the following methods.

Setting permissions

You can set the required permissions for the application based on the actual application needs.

Go to the "app/src/main" directory, open the "AndroidManifest.xml" file, and add the permissions.

Untitled
<!-- Required permissions for the SDK -->
<uses-permission android:name="android.permission.RECORD_AUDIO" />
1
Copied!
Warning

Due to the requirement for Android 6.0 and higher versions to request dynamic permissions for some critical permissions, it is not enough to only apply for static permissions through the "AndroidManifest.xml" file. Therefore, you also need to refer to the following code, where "requestPermissions" is a method of the "Activity".

Untitled
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.M) {
    if (ContextCompat.checkSelfPermission(this, Manifest.permission.RECORD_AUDIO) !=
            PackageManager.PERMISSION_GRANTED) {
        String[] permissions = {Manifest.permission.RECORD_AUDIO};
        requestPermissions(permissions, PERMISSION_REQUEST_CODE);
    }
}
1
Copied!

The specific permission details are as follows:

NecessityPermission Description Reason for Request
Required permissionRECORD_AUDIOAudio recording permission.This permission is needed to send audio.

Prevent confusion

In the "proguard-rules.pro" file, add the -keep class configuration for the SDK to prevent confusion with the SDK public class names.

Untitled
-keep class **.zego.**{*;}
1
Copied!

Previous

Overview

Next

Send and receive audio messages