Before you can use Log Service SDK for Android to call the API operations of Log Service, you must install Log Service SDK for Android. This topic describes how to install Log Service SDK for Android.

Prerequisites

  • Log Service is activated. For more information, see Activate Log Service.
  • An AccessKey pair is created and obtained. An Alibaba Cloud account has permissions to call all API operations. Therefore, security risks may arise if you use the AccessKey pair of an Alibaba Cloud account. We recommend that you log on as a RAM user that has permissions to call API operations or perform routine O&M. For more information, see AccessKey pair.
  • An Android development environment is set up. For more information, visit the official website of Android and Android Studio.

    Log Service SDK for Android supports Android 4.0 and later versions. You can run the adb shell getprop ro.build.version.release command to check the Android version that you install.

Installation

  1. Create an Android project.
  2. Configure the following code in build.gradle in the root directory of the project.
    mavenCentral()
  3. Configure the following code in the build.gradle in the directory of a specified module.
    implementation 'com.aliyun.openservices:aliyun-log-android-sdk:2.6.0'
    After dependency packages are imported, you can call the API operations that are encapsulated in Log Service SDK for Android in the project.

What to do next

Get started with Log Service SDK for Android