Door Lock SDK Integration
1. Overview
This document mainly introduces how to integrate the Door Lock SDK.
2. Prerequisites
- Confirm completion of Preparation
- Confirm completion of Environment Build
3. Features
3.1 Core Functions
- Supports Aqara door lock pairing
- Supports Aqara door lock control
3.2 SDK Size
| Dependency | Description | Size |
|---|---|---|
| React Native (0.81.6) | React Native framework | 10MB |
| Aqara bridge layer | Components required for SDK operation | 24MB |
| Others | Components required for SDK operation | 14MB |
| Total | - | 48MB |
Note: 48MB is the maximum incremental size of SDK integration, which occurs when there is no overlap between the third-party app’s dependencies and those of the SDK. In most cases, it will be smaller.
3.3 Supported Device Categories
See Device List for details.
4. Integration
4.1 Integrate the Door Lock SDK
4.1.1 Edit build.gradle in the app Directory
dependencies {
implementation 'com.lumi.external:core:2.2.62'
implementation 'com.lumi.commonui:ui:1.5.33'
implementation 'com.lumi.sdk:reactnative:8.1.2'
implementation 'com.lumi.sdk:rmextra:2.0.10'
implementation 'com.lumi.sdk:device-router:1.0.10'
implementation 'com.lumi.sdk:module-setting:2.0.35'
}
4.3.3 Edit AndroidManifest.xml
<application>
...
<provider
android:name="androidx.core.content.FileProvider"
android:authorities="${applicationId}.fileprovider"
android:exported="false"
android:grantUriPermissions="true">
<meta-data
android:name="android.support.FILE_PROVIDER_PATHS"
android:resource="@xml/custom_file_paths" />
</provider>
</application>
custom_file_paths.xml
<?xml version="1.0" encoding="utf-8"?>
<resources>
<paths>
<cache-path path="" name="camera_photos"/>
<external-path path="" name="camera_photos" />
<files-path path="" name="camera_photos" />
<root-path path="" name="camera_photos" />
<external-files-path name="share_files" path="."/>
</paths>
</resources>
4.4 Initialization
4.4.1 Unified Initialization
See Environment Build - Unified Initialization
5. Code Obfuscation
-dontwarn com.facebook.**
-keep class com.facebook.** { *; }