SDK Integration

Last Updated on : 2024-04-26 10:10:26download

Preparation for integration

Tuya Smart Sweeper Android SDK relies on the Tuya Smart Home Android SDK, and develop on this basis. Before starting to develop with the SDK, you need to register a developer account, create a product, etc. on the Tuya Developer Platform, and obtain a key to activate the SDK, see Tuya Smart Home Android SDK Integration.

Configure the root build.gradle

Add in repositories:

maven {
  url "https://maven-other.tuya.com/repository/maven-releases/"
}

Configure the build.gradle

Add the following codes to the build.gradle file.

dependencies{
implementation 'com.thingclips.smart:sweeper:5.1.0-9'
}

SDK initialization

ThingHomeSdk.init(appliction); // Home sdk init
ThingOptimusSdk.init(appliction); //Sweeper SDK init

IThingSweeperKitSdk: provides the data capability entrance of the laser sweeper and the download function of voice packets.

Call method:

IThingSweeperKitSdk iTuyaSweeperKitSdk = ThingOptimusSdk.getManager(IThingSweeperKitSdk.class);