Before using Simple Log Service (SLS) SDK for Android to call the API operations of SLS, install SLS SDK for Android.
Prerequisites
Simple Log Service is activated.
An Android development environment is set up. For more information, visit the official website of Android and Android Studio.
SLS SDK for Android supports Android 4.0 and later versions. You can run the
adb shell getprop ro.build.version.releasecommand to check the Android version that you install.
Installation
Create an Android project.
Configure the following code in
build.gradlein the root directory of the project.buildscript { // ... repositories { mavenCentral() // (Optional) Add the aliyun maven configuration to improve the access speed. // mirror of google() maven { url 'https://maven.aliyun.com/repository/google' } // mirror of central & jcenter maven { url 'https://maven.aliyun.com/repository/public' } } // ... }Configure the following code in the build.gradle in the directory of a specified module.
implementation 'io.github.aliyun-sls:aliyun-log-android-sdk:2.7.0@aar'After dependency packages are imported, you can call the API operations that are encapsulated in SLS SDK for Android in the project.