Fast Integration with IPC SDK for Android

Last Updated on : 2024-11-26 02:37:50download

IPC SDK helps you implement IP camera (IPC) functionalities on top of the modules provided by Cube App SDK, such as user management, device pairing, home management, and device management.

Before you start

The IPC SDK is developed based on the Cube App SDK. Before integration with the IPC SDK, perform the steps described in Fast Integration with Cube App SDK for Android.

Fast integration

Configure build.gradle

Contact the project manager to get the Tuya Maven repository’s account and password.

  • Configure the file build.gradle in the root directory of your project.

    allprojects {
        repositories {
            ...
            // Tuya Maven repository URL.
           maven {
                url 'https://maven-other.tuya.com/repository/maven-private/'
                credentials {
                    username ?
                    password ?
                }
            }
        ...
        }
    }
    
  • Configure build.gradle in the app directory.

    defaultConfig {
        ndk {
           abiFilters "armeabi-v7a","arm64-v8a"
        }
    }
    packagingOptions {
        pickFirst 'lib/*/libc++_shared.so'
        pickFirst 'lib/*/libyuv.so'
        pickFirst 'lib/*/libopenh264.so'
    }
    dependencies {
        ...
        implementation 'com.thingclips.smart:thingsmart-ipcsdk:5.9.2-cube'
        ...
    }
    
    • The earliest Android version supported by the IPC SDK is Android 6.0.0 (API level 21).
    • The IPC SDK supports armeabi-v7a and arm64-v8a by default.
    • The IPC SDK does not support P2P 1.0 devices by default. In this case, the value of p2pType for this type of device is 1. To use this type of device, contact Tuya’s account manager.
    • If you have integrated Cube App SDK v1.x.x-cube into your project, follow the instructions in Upgrade Guide and upgrade to the latest version.

Configure AndroidManifest.xml

Set permissions in AndroidManifest.xml.

<!-- 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

Configure obfuscation in proguard-rules.pro.

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