Install SLS SDK for Android to call SLS API operations from your Android app.
Prerequisites
-
Simple Log Service is activated. Activate Simple Log Service.
-
An Android development environment is set up. Get the Android SDK and Android Studio.
SLS SDK for Android requires Android 4.0 or later. Run
adb shell getprop ro.build.version.releaseto check your Android version.
Installation
-
Create an Android project.
-
Add the following to the root-level
build.gradleof your 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' } } // ... } -
Add the following dependency to your module-level build.gradle.
implementation 'io.github.aliyun-sls:aliyun-log-android-sdk:2.7.0@aar'You can then call SLS SDK for Android APIs in your project.