Integrate Linkus SDK for Android

This topic describes how to integrate Linkus SDK for Android with your Android project by manually importing the Linkus SDK AAR file.

Requirements and Prerequisites

Requirements
Make sure that your development environment meets the following requirements:
Development Environment Version Requirement
Java Java 11
Android 5.0 or later
Android Studio Arctic Fox or later
Gradle & Gradle Plugin
  • Gradle: 6.5
  • Android Gradle Plugin: 4.1.1
Note: If you are using other versions of 'Gradle' and 'Gradle Plugin', additional debugging may be required to ensure that the 'Linkus SDK for Android' works properly.
Prerequisites
You have enabled Linkus SDK and bound the push certificate.

Demo and Source code

Before the integration, we recommend that you try out the Demo and review the source code of 'Linkus SDK for Android' to have an overview of the framework and workflow of 'Linkus SDK for Android'.

For more information, go to the GitHub Repository of 'Linkus SDK for Android'.

Procedure

  1. Go to the GitHub Repository of 'Linkus SDK for Android', and download the latest version of linkus-sdk-x.x.x.aar.
    Note: x.x.x represents the version number of the Linkus SDK. Refer to Release Notes - Linkus SDK for Android to check the latest version number.
  2. Copy the linkus-sdk-x.x.x.aar file to the directory app > libs of your Android project.
  3. Import the AAR file of Linkus SDK to your project.
    Note:
    • The way to import AAR file varies depending on the development environment. Use the appropriate method based on your actual development environment.
    • If your project files use Kotlin syntax (with a .kts extension), you need to convert the following codes into Kotlin syntax.
    1. In the project root directory, open the build.gradle file, and add the following code in allprojects > repositories.
      flatDir {
          dirs 'app/libs'
      }

    2. In the app directory, open the build.gradle file and add the following code in dependencies.
      implementation(name: 'linkus-sdk-x.x.x', ext: 'aar')
      Note: linkus-sdk-x.x.x represents the file name (exclude the extension) of the Linkus SDK AAR file.
  4. Synchronize the project.

Result

You have integrated 'Linkus SDK for Android' with your project, you can Initialize Linkus SDK for Android.
Note: You do NOT need to set the obfuscation configuration, as the obfuscation files have already been included in the AAR file.