Host | Guest | Audience |
Host can start high-definition audio/video streaming, share screens, and manage participants. | Guest can enable their microphone for real-time voice discussions and sharing. | Supports unlimited concurrent audience entry, ultra-low latency viewing, and high-frequency chat. Audience can use "Raise Hand" to request guest access. |
![]() | ![]() | ![]() |
room and atomic_x subdirectories to the same directory level as your project's app folder.
settings.gradle.kts or settings.gradle to import the tuiroomkit component.include(":tuiroomkit")project(":tuiroomkit").projectDir = File(settingsDir, "room/tuiroomkit")include(":atomic_x")project(":atomic_x").projectDir = File(settingsDir, "atomic_x")
build.gradle.kts (or build.gradle), add the following dependency declaration:dependencies {// Add tuiroomkit dependencyapi(project(":tuiroomkit"))}
proguard-rules.pro file to prevent obfuscation and ensure functionality.-keep class com.tencent.** { *; }-keep class com.tencent.beacon.** { *; }-keep class com.tencent.cloud.iai.lib.** { *; }-keep class com.tencent.qimei.** { *; }-keep class com.tencent.xmagic.** { *; }-keep class com.tcmediax.** { *; }# Gson serialization/deserialization framework rules-keep class com.google.gson.** { *; }
tools:replace="android:allowBackup" and android:allowBackup="false" to the ` node in app/src/main/AndroidManifest.xml`:<manifest xmlns:android="http://schemas.android.com/apk/res/android"xmlns:tools="http://schemas.android.com/tools"><!-- Add this configuration to override SDK settings --><applicationandroid:allowBackup="false"tools:replace="android:allowBackup" /></manifest>

import android.os.Bundleimport androidx.appcompat.app.AppCompatActivityimport io.trtc.tuikit.atomicxcore.api.login.LoginStoreimport io.trtc.tuikit.atomicxcore.api.CompletionHandlerimport android.util.Logclass MainActivity : AppCompatActivity() {override fun onCreate(savedInstanceState: Bundle?) {super.onCreate(savedInstanceState)LoginStore.shared.login(this, // context1400000001, // Replace with your project's sdkAppID"test_001", // Replace with your project's userID"xxxxxxxxxxx", // Replace with your project's userSigobject : CompletionHandler {override fun onSuccess() {// Login successfulLog.d("Login", "login success");}override fun onFailure(code: Int, desc: String) {// Login failedLog.e("Login", "login failed, code: $code, error: $desc");}})}}
Parameter | Type | Description |
sdkAppID | Int | |
userID | String | Unique identifier for the current user. Only English letters, numbers, hyphens, and underscores are allowed. To avoid multi-device login conflicts, do not use 1, 123 or other simple IDs. |
userSig | String | Authentication ticket for Tencent Cloud. For development: Use GenerateTestUserSig.genTestSig or the UserSig Assistant Tool for a temporary UserSig.For production: Always generate UserSig server-side to prevent secret key leaks. See Calculating UserSig on the Server. |
setSelfInfo API on LoginStore:import android.util.Logimport io.trtc.tuikit.atomicxcore.api.CompletionHandlerimport io.trtc.tuikit.atomicxcore.api.login.LoginStoreimport io.trtc.tuikit.atomicxcore.api.login.UserProfileprivate val TAG = "Test"fun setSelfInfo() {val userProfile = UserProfile(userID = "test_001", // The userID used for loginnickname = "tom", // Set nicknameavatarURL = "http://xxx.png" // Set avatar URL)LoginStore.shared.setSelfInfo(userProfile, object : CompletionHandler {override fun onSuccess() {Log.d(TAG, "setSelfInfo success")}override fun onFailure(code: Int, desc: String) {Log.e(TAG, "setSelfInfo failed code:$code, message:$desc")}})}
Parameter | Type | Required | Description |
userProfile | UserProfile | Yes | Core user information: userID: User ID to set. nickname: Nickname. avatarURL: Avatar URL . |
completion | CompletionHandler | No | Callback for result. Returns error code and message on failure. |
RoomMainView component provides the core interface for multi-party audio/video rooms. The example below shows how to embed RoomMainView in your app as a host.RoomMainView with lazy loading.Activity's onCreate method, add RoomMainView and fill the layout.import android.os.Bundleimport androidx.appcompat.app.AppCompatActivityimport com.trtc.uikit.roomkit.view.RoomMainViewimport io.trtc.tuikit.atomicxcore.api.room.CreateRoomOptionsimport io.trtc.tuikit.atomicxcore.api.room.RoomType// MainActivity represents the Activity where you load the main room pageclass MainActivity : AppCompatActivity() {private val roomID = "webinar_123456"// 1 Load creation viewprivate val roomView: RoomMainView by lazy {RoomMainView(this).apply {// 2 Configure entry settingsval config = RoomMainView.ConnectConfig(autoEnableMicrophone = true, // Enable microphone on room entryautoEnableCamera = true, // Enable camera on room entryautoEnableSpeaker = true // Enable speaker on room entry)val options = CreateRoomOptions(roomName = "roomName") // Room nameval behavior = RoomMainView.RoomBehavior.Create(options)// 3 Initialize main room pageinit(roomID, RoomType.WEBINAR, behavior, config)}}override fun onCreate(savedInstanceState: Bundle?) {super.onCreate(savedInstanceState)// 4 Add view to ActivitysetContentView(roomView)}}
Parameter | Type | Description |
roomID | String | Unique room identifier. Length: 0–48 bytes. Use numbers, English letters (case-sensitive), underscores (_), hyphens (-). Avoid spaces and Chinese characters. |
roomType | RoomType | Room type: STANDARD: Standard room.WEBINAR: Large webinar room.Use WEBINAR for webinar scenarios. |
behavior | RoomBehavior | Initialization source. Create: Host creates room (requires creation options; see CreateRoomOptions). Join: Member joins room |
config | ConnectConfig | Controls which audio/video devices are enabled on room entry. |
Parameter | Type | Description |
autoEnableMicrophone | Boolean | Enable microphone on room entry. true: enabled (default). false: disabled. |
autoEnableCamera | Boolean | Enable camera on room entry. true: enabled (default). false: disabled. |
autoEnableSpeaker | Boolean | Enable speaker on room entry. true: enabled (default). false: disabled. |
Parameter Name | Type | Required | Description |
roomName | String | No | Room name (optional, defaults to empty string); 0–60 bytes; supports Chinese, English, numbers, special characters |
password | String | No | Room password (empty means no password); 0–32 bytes; recommend 4–8 digits for mobile entry. Password feature not supported for webinars; leave blank. |
isAllMicrophoneDisabled | Boolean | No | Disable microphone for all members. Only host/admin can enable microphone; panelists disabled by default. true: disabled. false: not disabled (default). |
isAllCameraDisabled | Boolean | No | Disable camera for all members. Only host/admin can enable camera; panelists disabled by default. true: disabled. false: not disabled (default). |
isAllScreenShareDisabled | Boolean | No | Disable screen sharing for all members. Only host/admin can share screen. true: disabled. false: not disabled (default). |
isAllMessageDisabled | Boolean | No | Disable chat messages (mute) for all members. Regular members cannot send text messages. true: disabled. false: not disabled (default). |
RoomMainView in your app for audience members.RoomMainView with lazy loading.Activity's onCreate method, add RoomMainView and fill the layout.webinar_.import android.os.Bundleimport androidx.appcompat.app.AppCompatActivityimport com.trtc.uikit.roomkit.view.RoomMainViewimport io.trtc.tuikit.atomicxcore.api.room.RoomType// MainActivity represents the Activity where you load the main room pageclass MainActivity : AppCompatActivity() {private val roomID = "webinar_123456"// 1 Load entry viewprivate val roomView: RoomMainView by lazy {RoomMainView(this).apply {// 2 Initialize main room pageinit(roomID, RoomType.WEBINAR, RoomMainView.RoomBehavior.Join)}}override fun onCreate(savedInstanceState: Bundle?) {super.onCreate(savedInstanceState)// 4 Add view to ActivitysetContentView(roomView)}}
RoomMainView, your app will have a complete webinar page—including member management, audio/video controls, screen sharing, live comments, video display, and room information—covering all TUIRoomKit core features.
RoomMainView main room page is highly customizable. You can tailor the UI to fit your product and business needs. The following overview details each view component in RoomMainView to help you adjust quickly.
Component | Description | Customization Suggestions |
Main room container, coordinates layout and data flow of subcomponents | Adjust background, safe area adaptation, and component visibility logic | |
Top navigation bar: room info, camera/audio controls, exit button | Replace icons, adjust background transparency, add custom buttons (recording, windowed mode) | |
Video stream display area, handles webinar streaming logic and auto-plays panelist streams | Modify layout, size, empty state view, video stream widgets | |
Bottom toolbar: microphone, camera, screen sharing, hand raise list, member management buttons | Rearrange button order and style (color, size); add business features (in-meeting call, beauty filters) |

Icon | Filename | Description |
![]() | roomkit_ic_camera_off.png | Camera off icon |
![]() | roomkit_ic_camera_on.png | Camera on icon |
![]() | roomkit_ic_microphone_off.png | Microphone off icon |
![]() | roomkit_ic_microphone_on.png | Microphone on icon |
![]() | roomkit_icon_user_room_manager.png | Microphone on icon |
![]() | roomkit_ic_video_seat_owner.png | Room owner icon |

LoginStore.shared.login once. We recommend linking both LoginStore.shared.login and LoginStore.shared.logout to your own login logic.FOREGROUND_SERVICE, FOREGROUND_SERVICE_CAMERA, FOREGROUND_SERVICE_MICROPHONE, and define the service:<uses-permission android:name="android.permission.FOREGROUND_SERVICE" /><uses-permission android:name="android.permission.FOREGROUND_SERVICE_CAMERA" /><uses-permission android:name="android.permission.FOREGROUND_SERVICE_MICROPHONE" /><serviceandroid:name=".MediaCaptureService"android:foregroundServiceType="camera|microphone" />
import android.app.NotificationChannelimport android.app.NotificationManagerimport android.app.Serviceimport android.content.Intentimport android.content.pm.ServiceInfoimport android.os.Bundleimport android.os.IBinderimport androidx.appcompat.app.AppCompatActivityimport androidx.core.app.NotificationCompatclass MainActivity : AppCompatActivity() {override fun onCreate(savedInstanceState: Bundle?) {super.onCreate(savedInstanceState)startForegroundService(Intent(this, MediaCaptureService::class.java))}}class MediaCaptureService : Service() {override fun onCreate() {super.onCreate()// 1. Create notification channelval channel = NotificationChannel("media", "Media Capture", NotificationManager.IMPORTANCE_LOW)getSystemService(NotificationManager::class.java).createNotificationChannel(channel)// 2. Build notificationval notification = NotificationCompat.Builder(this, "media").setContentTitle("In Audio/Video Call").setSmallIcon(android.R.drawable.ic_menu_call).build()// 3. Start foreground service, specify camera and microphone types (Android 14+ required)startForeground(1, notification,ServiceInfo.FOREGROUND_SERVICE_TYPE_CAMERA or ServiceInfo.FOREGROUND_SERVICE_TYPE_MICROPHONE)}override fun onBind(intent: Intent?): IBinder? = null}
Apakah halaman ini membantu?
Anda juga dapat Menghubungi Penjualan atau Mengirimkan Tiket untuk meminta bantuan.
masukan