Updated on 2024-03-07 GMT+08:00

Installing the SDK

If you have any questions during development, post them on the Issues page of GitHub. For details about parameters and usage of each API, see the API Reference

Use the Gradle of Android Studio to download and install the OBS Android SDK. The procedure is as follows:

  1. Open Android Studio. Click Start a new Android Studio project to go to the page for creating a project.
  2. Fill in the configuration items, such as Application name and Project location, and finish creating the project as prompted.
  3. In Android Studio, find the build.gradle file (not the one in the app folder) in the root directory of the new project and add the following information to the file:

    repositories{
         maven {
             url 'https://mirrors.huaweicloud.com/repository/maven/'
         }
         mavenCentral()
    }

  4. Find the dependencies node from the build.gradle file in the app folder of the new project and add a line to the node. as follows:

    implementation 'com.huaweicloud:esdk-obs-android:3.23.9.1'

  5. Open the AndroidManifest.xml file and add the following code segments to configure the SDK-required permissions:

    <uses-permission android:name="android.permission.INTERNET" /> 
    <uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE" /> 
    <uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" />
    <uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" /> 
    <uses-permission android:name="android.permission.ACCESS_WIFI_STATE" />
    <uses-permission android:name="android.permission.GET_TOP_ACTIVITY_INFO" />

  6. Compile the project and download the SDK using the gradle to complete the integration.