SDK Integration

Last Updated on : 2024-08-06 06:20:22download

Before you start

The Smart Lock SDK serves your development as an extension of Smart Life App SDK. For more information, see Preparation.

Integrate with the SDK

Add a dependency

Add the following dependency to the file build.gradle of module:

dependencies {
    ...
   implementation 'com.thingclips.smart:thingsmart-lock-sdk:5.5.2'
}

Add permissions

To scan and connect to Bluetooth devices, add the following permissions to AndroidManifest.xml. These permissions do not apply to non-Bluetooth devices.

<!-- Required. Allows applications to connect to paired bluetooth devices.  -->
<uses-permission android:name="android.permission.BLUETOOTH" />
<!-- Required. Allows applications to discover and pair bluetooth devices.  -->
<uses-permission android:name="android.permission.BLUETOOTH_ADMIN" />
<!-- Required.  Allows an app to scan bluetooth device.  -->
<uses-permission android:name="android.permission.ACCESS_FINE_LOCATION" />
<!-- Required.  Allows an app to scan bluetooth device.  -->
<uses-permission android:name="android.permission.ACCESS_COARSE_LOCATION" />
<!--  Allows an app to use bluetooth low energy feature  -->
<uses-feature
android:name="android.hardware.bluetooth_le"
android:required="false" />

For more information about dynamic permissions, see Android’s document Request app permissions.