Dashboard OEM SDK Integration and Usage
Revision History
| Date | Version | Changes |
|---|---|---|
| 2026.04.21 | v1.0.0 | Added the Dashboard OEM SDK integration and usage guide |
1. Overview
This document describes how to integrate the Dashboard OEM SDK into an Android host project and initialize it with the App.kt implementation from the OEM sample project. After initialization, the host project integrates dashboard pages and related business capabilities under the OEM channel.
2. Prerequisites
- Complete Preparation
- Complete Environment Build
- Prepare
AppId,AppKey, user login state, region, and language parameters required for initialization
3. Integration
3.1 Edit build.gradle in the app Module
Get the latest version: The Latest Version of the SDK
dependencies {
// Dashboard OEM SDK
implementation "com.lumi.module.oem:home:1.0.3"
}
3.2 Initialization
The Dashboard OEM SDK uses the unified initialization flow of the Lumi Android SDK. Do not initialize the OEM module separately. Initialize LumiCoreManager once in Application and set sdkChannel to LumiSDKChannel.CHANNEL_OEM_SDK.
Key points:
- Run initialization in
Application.onCreate() - Multiple calls to
init(...)are ignored; update parameters through the unified update flow ILumiUserInforeturns the real user ID, token, region, language, and supported device areaextensionsstores H5 addresses and other extension configuration
4. Usage
4.1 Initialize the OEM SDK in Application
The following example is based on the OEM sample project's App.kt:
class App : Application() {
override fun onCreate() {
super.onCreate()
val extensions = hashMapOf(
"BaseH5UrlV2" to "https://cdn.aqara.com/cdn/luoshu/mainland/app-h5/device/index.html#",
"AQARA_TOOL_BASE_URL" to BuildConfig.APP_BASE_H5 + BuildConfig.AQARA_TOOL_URL
)
LumiCoreManager.getInstance().init(
this,
BuildConfig.DEBUG,
LumiCoreManager.LumiCoreSDKConfig.builder()
.appId(BuildConfig.AppID)
.appKey(BuildConfig.AppKey)
.baseImageUrl("https://cdn.aqara.com/cdn/common/mainland/prd/statics/default")
.baseDocsUrl("https://cdn.aqara.com/cdn/app/mainland/static/docs/")
.extensions(extensions)
.sdkChannel(LumiSDKChannel.CHANNEL_OEM_SDK)
.userInfo(object : ILumiUserInfo {
override fun is12HourFormat(): Boolean {
return !DateFormat.is24HourFormat(this@App)
}
override fun getCountry(): String {
return LocationHelper.getCountryCode()
}
override fun getSupportDeviceArea(): String {
return LocationHelper.getSupportDeviceArea()
}
override fun getCoapServer(): String {
return LocationHelper.getFastlinkUrl()
}
override fun getUserId(): String? {
return SessionManager.getInstance().getUser()?.getUserId().orEmpty()
}
override fun getUserToken(): String? {
return SessionManager.getInstance().getUserToken()?.getUserToken().orEmpty()
}
override fun getArea(): String {
return SessionManager.getInstance().getAppConfig()?.getArea().orEmpty()
}
override fun getLanguage(): String {
return LanguageUtil.getLanguage()
}
})
.build()
)
}
}
4.2 Key Parameters
| Field | Type | Description | Source |
|---|---|---|---|
appId |
String |
Unique application identifier | Aqara Developer Platform |
appKey |
String |
Application key | Aqara Developer Platform |
baseImageUrl |
String |
Base URL for image resources | Aqara platform assignment or project configuration |
baseDocsUrl |
String |
Base URL for document resources | Aqara platform assignment or project configuration |
extensions |
HashMap<String, String> |
Extension configuration such as H5 URLs and tool page URLs | Host project configuration |
sdkChannel |
LumiSDKChannel |
SDK channel identifier. Use CHANNEL_OEM_SDK in the OEM scenario |
Host setting |
is12HourFormat() |
Boolean |
Time format flag used by time-related UI | System setting |
getCountry() |
String |
Current country code | Location or region service |
getSupportDeviceArea() |
String |
Supported device access area | Region capability service |
getCoapServer() |
String |
COAP or LAN networking server address | Network configuration service |
getUserId() |
String? |
Current user ID | Host login state |
getUserToken() |
String? |
Current user token | Host login state |
getArea() |
String |
Current service region | Host configuration center |
getLanguage() |
String |
Current language | Host language configuration |
4.3 Auto Login
When the host already has the user login state and needs to restore the account context after SDK initialization, call saveData(...) from the account module.
// Auto login
ARouter.getInstance().navigation(IAccount::class.java)
?.saveData(
token = "",
userId = "",
account = "",
userInfoJson = ""
)
saveData(...) signature:
fun saveData(
token: String? = "",
userId: String? = "",
account: String? = "",
userInfoJson: String? = ""
)
Parameter details:
| Field | Type | Description |
|---|---|---|
token |
String? |
User login token |
userId |
String? |
Unique user identifier |
account |
String? |
Account value, such as a phone number, email address, or business account |
userInfoJson |
String? |
JSON string that carries host-specific user extension data |
Call requirements:
- Call
saveData(...)afterLumiCoreManagerinitialization completes - Keep
tokenanduserIdconsistent with the current host login state - If full user information is not available, pass
token,userId, andaccountfirst
4.4 Integration Requirements
- After host login completes, make sure
SessionManageralready contains the user ID, token, and region data - If the project supports region switching or language switching, make sure
getArea()andgetLanguage()return the current values - Store the addresses in
extensionsthroughBuildConfigor a configuration center to avoid scattered hard-coded URLs - For auto login or session restore, connect the host account module after unified initialization completes
4.5 Sample Integration Summary
The OEM SDK integration flow is:
- Initialize
LumiCoreManager - Build initialization parameters with
LumiCoreSDKConfig.builder() - Set
sdkChanneltoLumiSDKChannel.CHANNEL_OEM_SDK - Inject the host login state, region, language, and time format through
ILumiUserInfo - Put the H5 and tool page extension addresses into
extensions
After these steps complete, the host project integrates dashboard pages and OEM business capabilities.