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

  1. Complete Preparation
  2. Complete Environment Build
  3. 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:

  1. Run initialization in Application.onCreate()
  2. Multiple calls to init(...) are ignored; update parameters through the unified update flow
  3. ILumiUserInfo returns the real user ID, token, region, language, and supported device area
  4. extensions stores 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:

  1. Call saveData(...) after LumiCoreManager initialization completes
  2. Keep token and userId consistent with the current host login state
  3. If full user information is not available, pass token, userId, and account first

4.4 Integration Requirements

  1. After host login completes, make sure SessionManager already contains the user ID, token, and region data
  2. If the project supports region switching or language switching, make sure getArea() and getLanguage() return the current values
  3. Store the addresses in extensions through BuildConfig or a configuration center to avoid scattered hard-coded URLs
  4. 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:

  1. Initialize LumiCoreManager
  2. Build initialization parameters with LumiCoreSDKConfig.builder()
  3. Set sdkChannel to LumiSDKChannel.CHANNEL_OEM_SDK
  4. Inject the host login state, region, language, and time format through ILumiUserInfo
  5. Put the H5 and tool page extension addresses into extensions

After these steps complete, the host project integrates dashboard pages and OEM business capabilities.

lumi LogoCopyright © 2023 Lumi United Technology Co., Ltd. all right reserved,powered by GitbookFile Modify: 2026-04-21 15:18:23

results matching ""

    No results matching ""