This document describes how to quickly run the IM demo for Android.
Note:If you already have an app, record its SDKAppID and obtain key information.
A Tencent Cloud account can create a maximum of 300 IM apps. If you want to create a new app, disable and delete an unwanted app first. Once an app (along with its SDKAppID) is deleted, the provided service and all its data are lost. Please proceed with caution.
Note:Please store the key information properly to prevent disclosure.
Download the IM demo project. For more information, see SDK and Demo Source Code.
Note:To respect the copyright of emoji design, the downloaded demo project does not contain sliced images of major emoji elements. You can use your local emoji packs to configure code. Unauthorized use of the emoji pack in the IM demo may infringe on the design copyright.
Open the project in the terminal directory and find the file GenerateTestUserSig
in Android/Demo/app/src/main/java/com/tencent/qcloud/tim/demo/signature/GenerateTestUserSig.java
.
Set relevant parameters in the GenerateTestUserSig
file:
Note:In this document, the method to obtain
UserSig
is to configure aSECRETKEY
in the client code. In this method, theSECRETKEY
is vulnerable to decompilation and reverse engineering. Once yourSECRETKEY
is disclosed, attackers can steal your Tencent Cloud traffic. Therefore, this method is only suitable for locally running a demo project and feature debugging.
The correctUserSig
distribution method is to integrate the calculation code ofUserSig
into your server and provide an app-oriented API. WhenUserSig
is needed, your app can send a request to the business server to obtain a dynamicUserSig
. For more information, see Generating UserSig on the Server.
Import the demo project with Android Studio, and then compile and run it.
For more information, see the file README.md
in the corresponding directory of the demo project cloned in Step 3.
Note:The demo is integrated with the audio/video call feature by default. However, the TRTC SDK on which the audio/video call feature relies currently does not support simulators. Please use real devices for demo running or debugging.
Was this page helpful?