Integrating Tencent Cloud Real-Time Audio/Video SDK for Android: A Step-by-Step Guide
To add multi‑person video calling with in‑call text chat on Android, developers register a Tencent Cloud account, obtain an APPID, purchase a low‑cost minute package, import the IMSDK/AVSDK/ILiveSDK/BeautySDK, generate a userSig, initialize and log in the SDK, create or join a room, bind an AVRootView for video rendering, and enable IM messaging, resulting in a functional solution built within a day.
Background
The author, a senior engineer from Tencent Cloud Terminal team, was assigned a task to implement a multi‑person video call feature similar to WeChat/QQ, with an additional text‑chat function in the video interface. After researching solutions, he chose Tencent Cloud's real‑time audio/video service because of its stability, quality, and built‑in IM capability.
Four main steps to get started
1. Register a Tencent Cloud account
Visit the official website and create an account. You can log in directly with a QQ or WeChat account.
2. Apply for an APPID
Log in to the Tencent Cloud console, navigate to Cloud Products → Real‑Time Audio/Video → Create New Application , fill in the required information, and generate a unique APPID that will be used when integrating the SDK.
3. Purchase a 1‑yuan package
After the APPID is bound to the service, call usage is billed by minute. The cheapest 1‑yuan package provides 10,000 minutes per month, which is sufficient for testing.
4. SDK Integration
The core of the integration consists of several sub‑steps:
4.1 Integrate the SDK
Tencent provides four SDK modules. The essential ones are:
SDK
Description
IMSDK
Instant messaging functionality
AVSDK
Low‑level audio/video capabilities
ILiveSDK
Higher‑level wrapper over AVSDK for easier use
BeautySDK
Beauty preprocessing for video streams
Download the SDK package and import it into your Android project.
4.2 Generate userSig
Each user needs a userSig (a signed token) for authentication. The steps are:
Download the private key from the console.
Copy the private key (no need to unzip).
In the console’s Development Assistance section, paste the key, enter the user name, and click Generate Signature . Copy the resulting userSig.
4.3 Initialize and login
Place the initialization code in your application start‑up (e.g., Application.onCreate() ).
// Initialize iLiveSDK
ILiveSDK.getInstance().initSdk(this, Constants.SDKAPPID, Constants.ACCOUNTTYPE);
// Initialize iLiveSDK room manager
ILiveRoomManager.getInstance().init(new ILiveRoomConfig().setRoomMsgListener(this));Then log in with the generated userId and userSig:
ILiveLoginManager.getInstance().iLiveLogin(userId, userSig, callback);4.4 Enter a room and render video
Add an AVRootView to your layout:
<com.tencent.ilivesdk.view.AVRootView
android:id="@+id/av_root_view"
android:layout_width="match_parent"
android:layout_height="match_parent" />Bind the view to the SDK:
ILiveRoomManager.getInstance().initAvRootView(avRootView);Create or join a room (roomId is provided by your business logic):
// Create room
ILiveRoomManager.getInstance().createRoom(roomId, new ILiveRoomOption(), callback);
// Join existing room (same API is used)
ILiveRoomManager.getInstance().createRoom(roomId, new ILiveRoomOption(), callback);4.5 Message handling (text chat in video)
Enable IM support when entering the room and set a message listener. Sending a text message is straightforward:
// Send a text message
ILiveMessage message = new ILiveTextMessage(test);
ILiveRoomManager.getInstance().sendGroupMessage(message, callback);The received messages are delivered via the listener set in ILiveRoomConfig.setRoomMsgListener .
Result
Within a day, a functional multi‑person video call with text chat was built. The article concludes with a screenshot of the final UI and invites readers to leave comments for any issues.
Tencent Cloud Developer
Official Tencent Cloud community account that brings together developers, shares practical tech insights, and fosters an influential tech exchange community.
How this landed with the community
Was this worth your time?
0 Comments
Thoughtful readers leave field notes, pushback, and hard-won operational detail here.