This sample demonstrates the use of Tuya Smart Residence App SDK to build a smart residence app. The SDK is divided into several functional modules to give you a clear insight into the implementation of different features, including the user registration process, site management by different users, app access management, and password access management.
- Android Studio Arctic Fox | 2020.3.1 Patch 3 Build #AI-203.7717.56.2031.7784292, built on October 1, 2021
- Gradle 7.0 and later
-
Tuya Smart Residence App SDK is integrated based on Gradle. Required resources must be installed.
-
Clone or download this sample.
-
This sample requires you to get a pair of keys and a security image from Tuya Developer Platform, and register a developer account on this platform if you do not have one. Then, perform the following steps:
-
Log in to the Tuya IoT Development Platform. In the left-side navigation pane, choose App > SDK Development.
-
Click Create to create an app.
-
Fill in the required information, such as the app name and package name.
-
You can find the AppKey, AppSecret, and security image on the Get Key tab.
-
-
Open the sample project
AndroidManiFest.xml
. -
Fill in the AppKey and SecretKey in the AndroidManiFest.xml file.
<meta-data android:name="TUYA_SMART_APPKEY" android:value="" /> <meta-data android:name="TUYA_SMART_SECRET" android:value="" />
-
Download the security image, rename it
t_s.bmp
, and then drag it to theassets
directory.Note: The package name, AppKey, AppSecret, and security image must be the same as those used for your app on the Tuya IoT Development Platform. Otherwise, the sample cannot be run as expected.
-
Configure the running environment of Jetpack Compose to develop the sample. For more information, see Android's documentation.
-
Run gradle sync.
For more information about Tuya Smart Residence App SDK, see Smart Residence App SDK.