English
English
简体中文
Contact Us
Register
Log In
Language
English
English
简体中文
Contact Us
Log In
Register
Go to main website
App Develop

App Development

Tuya provides multiple mobile app development methods such as no-code or IoT App SDK development to maximize the monetization of IoT apps.
layoutIndex

Fast Integration with IPC SDK for Android

Last Updated on : 2021-11-25 07:50:01download

The IPC SDK for Android helps you implement IP camera (IPC) functionalities on top of the modules provided by the Smart Life App SDK. You must integrate the IPC SDK with the Smart Life App SDK during the app development. For more information, see Fast Integration with Smart Life App SDK for Android.

Fast integration

Configure the build.gradle file

  • Add the following code block to the project build.gradle file.

    allprojects {
        repositories {
            ...
            maven {
                url "https://maven-other.tuya.com/repository/maven-releases/"
            }
        ...
        }
    }
    
  • Add the following code block to the app build.gradle file.

    defaultConfig {
        ndk {
            abiFilters "armeabi-v7a","arm64-v8a"
        }
    }
    dependencies {
        ...
        implementation 'com.tuya.smart:tuyasmart-ipcsdk:3.32.5'
        ...
    }
    
    • Tuya IPC SDK solely supports the platform of armeabi-v7a and arm64-v8a.
    • By default, the SDK no longer supports P2P 1.0 devices (p2ptype = 1). To use them, you must add dependencies: implementation com.tuya.smart:tuyasmart-ipc-camera-v1:3.20.0.

Set the AndroidManifest.xml

Configure required permissions in the AndroidManifest.xml file.

<!-- sdcard -->
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" />
<uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE" />
<!-- Network -->
<uses-permission android:name="android.permission.INTERNET" />
<uses-permission android:name="android.permission.CHANGE_NETWORK_STATE" />
<uses-permission android:name="android.permission.CHANGE_WIFI_STATE" />
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />
<uses-permission android:name="android.permission.ACCESS_WIFI_STATE" />
<uses-permission android:name="android.permission.RECORD_AUDIO" />
<uses-permission android:name="android.permission.MODIFY_AUDIO_SETTINGS" />

Obfuscate the code

Arrange aliasing configuration in corresponding proguard-rules.pro files.

-keep class com.tuyasmart.**{*;}
-dontwarn com.tuyasmart.**

Note: The P2P 1.0 devices (p2ptype = 1) are supported. However, you need to add the following config rules:

-keep class com.tutk.**{*;}
-dontwarn com.tutk.**

Demo app

Smart Life App SDK Demo App contains the control panel module for IPCs.

  • Live video panel: P2P connection process of IPC device, live video, memory card recording, screenshots, intercom, and more features.
  • Playback panel: Recording and playback of video clips in the device memory card, and use of timeline components.
  • Cloud storage panel: cloud storage service activation, status detection, cloud storage of videos, and cloud storage event acquisition and playback.
  • Message panel: acquisition and display of alert messages.
  • Setting panel: use of standard IPC data points (DPs).