Last Updated on : 2024-06-24 08:30:46download
Device Control UI BizBundle for Android is the core container of the control panel for each Connected by Tuya
device. Based on Commercial Lighting Smart App SDK for Android, the UI BizBundle encapsulates the APIs to load and control panels and accelerates the application development process.
The UI BizBundle supports the following features:
Tuya Smart App SDK for Android is integrated into your project with Android Studio. The Commercial Lighting App SDK and Device Control UI BizBundle are added to your project.
The UI BizBundle includes the open source React Native framework (v0.59.10).
If your Android project does not integrate with React Native, follow the procedure in this topic to integrate with the UI BizBundle.
If your Android project has integrated with React Native, perform the following steps to check whether the UI BizBundle can be integrated:
If the version of the Commercial Lighting App SDK you are using is greater than or equal to v1.11.3, the version of the panel Bizbundle also needs to be upgraded to v1.11.3 simultaneously. Otherwise, you cannot enable the device panel.
If both methods failed, the UI BizBundle cannot be integrated.
Configure the build.gradle
file.
dependencies {
api enforcedPlatform("com.thingclips.smart:thingsmart-BizBundlesBom:2.8.0-bizbundle-lamp-2.8.0.27")
api ("com.thingclips.smart:thingsmart-bizbundle-lamp_panel")
}
Obfuscate the code.
# react-native
-keep,allowobfuscation @interface com.facebook.common.internal.DoNotStrip
-keep,allowobfuscation @interface com.facebook.proguard.annotations.DoNotStrip
-keep,allowobfuscation @interface com.facebook.proguard.annotations.KeepGettersAndSetters
# Do not strip any method/class that is annotated with @DoNotStrip
-keep @com.facebook.proguard.annotations.DoNotStrip class *
-keep @com.facebook.common.internal.DoNotStrip class *
-keepclassmembers class * {
@com.facebook.proguard.annotations.DoNotStrip *;
@com.facebook.common.internal.DoNotStrip *;
}
-keepclassmembers @com.facebook.proguard.annotations.KeepGettersAndSetters class * {
void set*(***);
*** get*();
}
-keep class * extends com.facebook.react.bridge.JavaScriptModule { *; }
-keep class * extends com.facebook.react.bridge.NativeModule { *; }
-keepclassmembers,includedescriptorclasses class * { native <methods>; }
-keepclassmembers class * { @com.facebook.react.uimanager.UIProp <fields>; }
-keepclassmembers class * { @com.facebook.react.uimanager.annotations.ReactProp <methods>; }
-keepclassmembers class * { @com.facebook.react.uimanager.annotations.ReactPropGroup <methods>; }
-dontwarn com.facebook.react.**
-keep class com.facebook.** { *; }
-keep,includedescriptorclasses class com.facebook.react.bridge.** { *; }
# AutoNavi
-dontwarn com.amap.**
-keep class com.amap.api.maps.** { *; }
-keep class com.autonavi.** { *; }
-keep class com.amap.api.trace.** { *; }
-keep class com.amap.api.navi.** { *; }
-keep class com.autonavi.** { *; }
-keep class com.amap.api.location.** { *; }
-keep class com.amap.api.fence.** { *; }
-keep class com.autonavi.aps.amapapi.model.** { *; }
-keep class com.amap.api.maps.model.** { *; }
-keep class com.amap.api.services.** { *; }
#Google Play Services
-keep class com.google.android.gms.common.** {*;}
-keep class com.google.android.gms.ads.identifier.** {*;}
-keepattributes Signature,*Annotation*,EnclosingMethod
-dontwarn com.google.android.gms.**
#MPAndroidChart
-keep class com.github.mikephil.charting.** { *; }
-dontwarn com.github.mikephil.charting.**
-keep class com.tuya.**.**{*;}
-dontwarn com.tuya.**.**
-keep class com.thingclips.**.**{*;}
-dontwarn com.thingclips.**.**
-keep,includedescriptorclasses class com.facebook.v8.** { *; }
#TTT
-keep class * extends com.thingclips.android.universal.base.ThingBaseUniPlugin { *; }
-keep class com.thingclips.smart.plugin.*.bean.**{ *; }
Enters a device panel by device ID.
API description
goPanelWithCheckAndTip(Activity activity, String devId)
Parameters
Parameter | Description |
---|---|
activity | The context of the current page. |
devId | The device ID, which can be obtained from the SDK. |
Example
AbsPanelCallerService service = MicroContext.getServiceManager().findServiceByInterface(AbsPanelCallerService.class.getName());
service.goPanelWithCheckAndTip(PanelActivity.this, bean.devId);
Error code | Description |
---|---|
1901 | Failed to download a specified panel. |
1902 | Failed to download a specified multilingual package. |
1903 | The specified device type is not supported. |
1904 | No devices are found in a specified group. |
1905 | The specified project ID is incorrect. |
1906 | DeviceBean is set to null . |
1907 | No panel resources can be downloaded. |
1908 | The specified firmware version is incorrect. |
1909 | An unknown error has occurred. |
Is this page helpful?
YesFeedbackIs this page helpful?
YesFeedback