Smart Lock SDK

Last Updated on : 2024-05-16 06:44:30download

Smart Lock SDK for Android encapsulates the APIs to communicate with smart locks over Bluetooth and Wi-Fi and accelerates lock app development. The SDK supports the following features:

  • Lock user system: manage lock users and associated passwords
  • Unlocking with passwords: get dynamic passwords and manage temporary passwords
  • Lock usage records: unlocking records, doorbell records, and alerts

The SDK is currently available in preview, being continuously optimized. If you have any problems or suggestions about the SDK, submit a ticket to request technical support.

Before you start

The Smart Lock SDK serves your development as an extension of Cube App SDK.

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.1.1'
}

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.