Last Updated on : 2024-09-23 03:35:20download
Home Management UI BizBundle is used to implement features such as management of homes, members, and rooms. It provides the basis to manage paired devices. Each home is the maximum scope in which smart scenes can be run.
Users can assign rooms to devices for homes. Home members can be granted different permissions on preferred operations.
Integrate Smart Life App SDK for Android into your project with Android Studio and add the framework of the UI BizBundle to your project. For more information, see Integrate with Framework.
build.gradle
of moduledependencies {
implementation 'com.thingclips.smart:thingsmart-bizbundle-family:2.0.0-cube.2'
implementation 'com.thingclips.smart:thingsmart-commonbiz-family:5.0.0-rc.3'
}
Navigates to the home management page through the route implemented by the following method:
UrlRouter.execute(UrlRouter.makeBuilder(FamilyManageActivity.this, "family_manage"));
The logic to process a home invitation is not supported by the UI BizBundle. You can implement this logic on your app homepage or other phases in which you want to process the invitation.
Home invitation messages are sent over MQTT. Therefore, the Home Management UI BizBundle provides the following methods to listen for home invitation messages:
// Registers a listener.
ThingHomeSdk.getHomeManagerInstance()
.registerThingHomeChangeListener(HomeInviteListener listener);
// Unregisters a listener.
ThingHomeSdk.getHomeManagerInstance()
.unRegisterThingHomeChangeListener(HomeInviteListener listener);
Example:
ThingHomeSdk.getHomeManagerInstance()
.registerThingHomeChangeListener(new HomeInviteListener() {
@Override
public void onHomeInvite(long homeId, String homeName) {
// accept or reject invitation from this family
ThingHomeSdk.getMemberInstance()
.processInvitation(homeId, isAccept, new IResultCallback() {
@Override
public void onError(String errorCode, String errorMsg) {
}
@Override
public void onSuccess() {
// Do something like refresh family list
}
});
}
});
Is this page helpful?
YesFeedbackIs this page helpful?
YesFeedback