Demo App

Last Updated on : 2023-12-07 03:15:40download

The demo app mainly demonstrates the SDK development process. Before developing the app, it is recommended to complete the operation of the Demo app according to this document.

Overview

After completing the Preparation for Integration section, you will get the AppKey, AppSecret, and security picture information used by the SDK. When integrating the SDK, please confirm that the AppKey, AppSecret, and security pictures are consistent with the information on the platform. Any mismatch will cause the SDK to be unusable.

For more information, see tuya-home-android-sdk-sample-java or tuya-home-android-sdk-sample-kotlin in the GitHub.

Demo app includes:

  • User module: Account (mobile phone or email) registration and login

  • Home management and device management module: including home creation and current home switching. Display of device list and control of device function point in the home. Device rename and device removal.

  • Device activator module: including smartConfig mode, AP mode, wired gateway distribution network, gateway sub-device activator, Bluetooth low energy, and dual-mode.

    Demo App

Run the demo

  1. Replace the applicationId in the build.gradle file in the app directory with the package name of your application.

    Demo App

  2. Name your security picture: “t_s.bmp” and put it in the “src”-“main”-“assets” folder under the app directory.

    Demo App
  3. Fill your AppKey and AppSecret into the corresponding <meta-data> tags in AndroidManifest.xml.

    Demo App

  4. Then click run to run your demo.

Troubleshooting

API interface request prompt signature error

{ "success": false, "errorCode" : "SING_VALIDATE_FALED", "status" : "error", "errorMsg" : "Permission Verification Failed", "t" : 1583208740059 }
  • Please check whether your AppKey, AppSecret, and Security Picture are configured correctly and are consistent with those obtained in the Preparation for Integration section.
  • Please check whether the security picture in the correct directory and the file name ist_s.bmp.