Group Management UI BizBundle

Last Updated on : 2024-04-01 06:19:57download

Group Management UI BizBundle provides the service logic and UI encapsulation for device groups. This allows users to create and modify device groups.

Functional description

Tuya allows users to create device groups by device type and centralize device control in the same group.

Integrate with the UI BizBundle

Create a project

Integrate Smart Life App SDK for Android into your project with Android Studio, and add the UI BizBundle to your project. For more information, see Integrate with Framework.

Integrate with the UI BizBundle

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


dependencies {
    api enforcedPlatform("com.thingclips.smart:thingsmart-BizBundlesBom:${biz_bom_version}")
    implementation 'com.thingclips.smart:thingsmart-bizbundle-groupmanager'
    api "com.thingclips.smart:thingsmart:${sdk_version}}"
}

Implement features

Create a group

API description

GroupState ThingGroupManager.getInstance().createGroup(Activity activity,String devId);

Parameters

Parameter Description
activity The object of Activity.
devId The device ID.

Return values of GroupState

Value Description
SUPPORT Indicates that a group can be created with the device.
NOT_SUPPORT Indicates that a group cannot be created with the device.
NONE Indicates that the specified device does not exist.

Modify a group

API description

GroupState  ThingGroupManager.getInstance().editGroup(Activity activity,long groupId);

Parameters

Parameter Description
activity The object of Activity.
groupId The group ID.

Return values of GroupState

Value Description
SUPPORT Indicates that the group can be modified.
NONE Indicates that the specified group does not exist.

Control a group

Users can open a group panel to control the group. For more information about how to open a group panel, see Open a group panel.