Initialize Linkus SDK for Android

Before using the 'Linkus SDK for Android', you need to initialize it to launch the core services and components. 'Linkus SDK for Android' supports default initialization and custom initialization.

Prerequisites

You have integrated 'Linkus SDK for Android' with your Android project.

Restriction

Initialization can only be performed once and must be performed in the main process.

Background information

Default configuration of 'Linkus SDK for Android'
The following table shows the general configuration items and their default values or settings for the 'Linkus SDK for Android'.
Configuration Item Default Value / Setting
Audio Codec iLBC
Automatic Gain Control (AGC) Disabled
Echo Cancellation (EC) Disabled
Audio Debugging Disabled
Noise Cancellation (NC) Enabled
Call Waiting Enabled
Initialization options
'Linkus SDK for Android' supports default initialization and custom initialization. Choose either of the following ways to initialize 'Linkus SDK for Android'.

Initialize 'Linkus SDK for Android' with the default configuration

Method
Call the following method within Application#onCreate of the project to initialize 'Linkus SDK for Android' with the default configuration.
YlsBaseManager.getInstance().initYlsSDK(this, null);
Sample code

Initialize 'Linkus SDK for Android' with custom configuration

Method
Call the following method within Application#onCreate of the project to customize the configuration items for 'Linkus SDK for Android' and initialize it.
YlsInitConfig config = new YlsInitConfig.Builder(projectPath)// Specify the storage location for Linkus SDK data (including logs)
        .supportCallWaiting(true)// Decide whether to enable Call Waiting. true:Enable; false:Disable
        .agc(true)// Decide whether to enable Automatic Gain Control (AGC). true:Enable; false:Disable
        .ec(true)// Decide whether to enable Echo Cancellation (EC). true:Enable; false:Disable
        .nc(true)// Decide whether to enable Noise Cancellation (NC). true:Enable; false:Disable
        .key("")// Optional. Specify the password for accessing database
        .build();// Initialize 'Linkus SDK for Android' with the configurations above
        YlsBaseManager.getInstance().initYlsSDK(this, config);
Sample code

What to do next

Request the SDK login signature from PBX server for authentication and login to 'Linkus SDK for Android'.

For more information, see Obtain Login Signature for 'Linkus SDK for Android'.