跳到主要内容

Quick Start: Android

Get VLPlay SDK running in your Android project in under 5 minutes. [PLACEHOLDER] This guide assumes you have already created a VLPlay application on your VLPlay representative and have your App ID ready.

[PLACEHOLDER] VLPlay SDK for Android is distributed via Maven. Add the dependency to your Gradle files, initialize the SDK in your Application class, and you are ready to call any SDK feature.

Step 1: Add Dependency

Add the VLPlay Maven repository and SDK dependency to your project:

settings.gradle.kts
dependencyResolutionManagement {
repositories {
google()
mavenCentral()
maven { url = uri("https://maven.vlplay.vn/releases") }
}
}
app/build.gradle.kts
dependencies {
implementation("vn.vlplay:sdk-android:1.0.0")
}

Step 2: Initialize the SDK

MyApplication.kt
import android.app.Application
import vn.vlplay.sdk.VLPlaySDK

class MyApplication : Application() {
override fun onCreate() {
super.onCreate()
VLPlaySDK.initialize(
context = this,
appId = "YOUR_APP_ID",
clientSecret = "YOUR_CLIENT_SECRET"
)
}
}

Step 3: Verify

MainActivity.kt
import vn.vlplay.sdk.VLPlaySDK

class MainActivity : AppCompatActivity() {
override fun onCreate(savedInstanceState: Bundle?) {
super.onCreate(savedInstanceState)
val version = VLPlaySDK.version
Log.d("VLPlay", "SDK initialized: $version")
}
}

Next: Full Android Installation Guide