Host Preparation Page | Host Live Stream Page | Waterfall Layout | Audience Viewing Page |
![]() | ![]() | ![]() | ![]() |

settings.gradle.kts (or settings.gradle) file in the project root directory: Add the jitpack repository dependency (to download the third-party library SVGAPlayer for playing gift svg animations):dependencyResolutionManagement {repositoriesMode.set(RepositoriesMode.FAIL_ON_PROJECT_REPOS)repositories {google()mavenCentral()// Add jitpack repository urlmaven { url = uri("https://jitpack.io") }}}
dependencyResolutionManagement {repositoriesMode.set(RepositoriesMode.FAIL_ON_PROJECT_REPOS)repositories {google()mavenCentral()// Add jitpack repository urlmaven { url 'https://jitpack.io' }}}
settings.gradle.kts (or settings.gradle) file in the project root directory. It enables importing the tuilivekit component downloaded in step two into your current project:include(":tuilivekit")
include ':tuilivekit'
build.gradle.kts (or build.gradle) file under the app directory and add the following code in it. It declares the current app's dependency on the newly joined tuilivekit component:api(project(":tuilivekit"))
api project(':tuilivekit')
TRTC SDK, Chat SDK, tuiroomengine as well as public library tuicore. No need for developers to configure separately. If needed, just modify tuilivekit/build.gradle file to upgrade.proguard-rules.pro file to include certain SDK classes in the non-obfuscation list:-keep class com.tencent.** { *; }-keep class com.trtc.uikit.livekit.livestreamcore.** { *; }-keep class com.trtc.uikit.livekit.component.gift.store.model.** { *; }-keep class com.squareup.wire.** { *; }-keep class com.opensource.svgaplayer.proto.** { *; }-keep class com.tcmediax.** { *; }-keep class com.tencent.** { *; }-keep class com.tencent.xmagic.** { *; }-keep class androidx.exifinterface.** {*;}-keep class com.google.gson.** { *;}# Tencent Effect SDK - beauty-keep class com.tencent.xmagic.** { *;}-keep class org.light.** { *;}-keep class org.libpag.** { *;}-keep class org.extra.** { *;}-keep class com.gyailib.**{ *;}-keep class com.tencent.cloud.iai.lib.** { *;}-keep class com.tencent.beacon.** { *;}-keep class com.tencent.qimei.** { *;}-keep class androidx.exifinterface.** { *;}
AndroidManifest.xml file under the app directory, add tools:replace="android:allowBackup" and android:allowBackup="false" in the application node, overwrite the settings within component, and use your own settings.// app/src/main/AndroidManifest.xml<application...// add the following configuration to overwrite the configuration in the dependent sdkandroid:allowBackup="false"tools:replace="android:allowBackup">
// Log inTUILogin.login(applicationContext,1400000001, // replace with the SDKAppID obtained in step 1"denny", // replace with your UserID"xxxxxxxxxxx", // You can count a UserSig in the console and fill it in this locationobject : TUICallback() {override fun onSuccess() {Log.i(TAG, "login success")}override fun onError(errorCode: Int, errorMessage: String) {Log.e(TAG, "login failed, errorCode: $errorCode msg:$errorMessage")}})
// Log inTUILogin.login(context,1400000001, // replace with the SDKAppID obtained in step 1"denny", // replace with your UserID"xxxxxxxxxxx", // You can count a UserSig in the console and fill it in this locationnew TUICallback() {@Overridepublic void onSuccess() {Log.i(TAG, "login success");}@Overridepublic void onError(int errorCode, String errorMessage) {Log.e(TAG, "login failed, errorCode: " + errorCode + " msg:" + errorMessage);}});
Parameters | Type | Overview |
SDKAppID | int | In step 1, you have already obtained it in the final step. No redundancy here. |
UserID | String | The current user ID, string type, only allows letters (a-z and A-Z), digits (0-9), hyphens, and underscores. |
userSig | String | Step 1: Use the SecretKey obtained in step 3 to encrypt information such as SDKAppID and UserID. This process generates a UserSig, which is an authentication token used by Tencent Cloud to verify if the current user can access the TRTC service. You can generate a temporary UserSig using the auxiliary tool in the console. For more information, see how to calculate and use UserSig. |
GenerateTestUserSig.genTestSig function to generate userSig. In this method, the SDKSecretKey is very easy to decompile and reverse engineer. Once your key is leaked, attackers can misappropriate your Tencent Cloud traffic.Feedback