Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
3 changes: 3 additions & 0 deletions application/.gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -14,3 +14,6 @@
.cxx
local.properties
.idea/
app/build/
login/build/
assembly/build/
95 changes: 95 additions & 0 deletions application/README.cn.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,95 @@
# RTCube

[English](README.md) | 简体中文

## 概述

RTCube 是一款功能强大的 UI 组件库,它基于腾讯云 `AtomicXCore` SDK 构建。`AtomicXCore` 整合了腾讯云实时音视频(TRTC)、即时通信(IM)、音视频通话(TUICallEngine) 和房间管理(TUIRoomEngine) 的核心能力,提供了状态驱动的(State-driven)API 设计。

RTCube 在 `AtomicXCore` 提供的核心能力之上,为您提供了一套预制的用户界面(UI),使您无需关心复杂的后端逻辑和状态管理,即可快速为您的 Android 应用集成视频互动直播、语音聊天室、音视频通话等功能。

## 功能特性

RTCube 基于 `AtomicXCore` 提供了以下核心业务场景的完整 UI 实现:

* **视频/语音直播 (Live Streaming):**

* **直播列表管理:** 拉取直播列表。
* **开播与观看:** 创建直播间、加入直播。
* **麦位管理:** 支持麦位管理,观众上麦/下麦。
* **主播连麦 (Co-hosting):** 支持主播与主播(跨房)连麦。
* **主播 PK (Battle):** 支持主播间 PK 互动。
* **互动功能:**
* **礼物:** 支持发送和接收礼物。
* **点赞:** 支持直播间点赞。
* **弹幕:** 支持发送和接收弹幕消息。

* **音视频通话 (Calling):**

* **基础通话:** 支持 1v1 及多人音视频通话。
* **通话管理:** 支持接听、拒绝、挂断。
* **设备管理:** 支持通话中的摄像头和麦克风控制。
* **通话记录:** 支持查询和删除通话记录。

* **多人会议 (Room):**

* **快速会议:** 支持一键创建/加入多人会议。
* **邀请入会:** 支持邀请成员加入当前会议。
* **会中管控:** 支持主持人对成员的音视频、麦位、成员列表进行管理。
* **共享屏幕:** 支持会中屏幕共享。

## 快速开始

### 1. 环境准备

* Android Studio Giraffe (2022.3.1) 或更高版本
* JDK 17
* Android Gradle Plugin 8.x
* Android 7.0(API 24)或更高版本

### 2. 克隆仓库

```bash
git clone https://github.com/Tencent-RTC/TUIKit_Android.git
```

### 3. 打开工程

使用 Android Studio 打开 `TUIKit_Android/application` 目录,等待 Gradle 同步完成。 `settings.gradle` 中接入了 `tuilivekit`、`tuicallkit-kt`、`tuiroomkit` 等必要的 AtomicXCore 组件模块。

### 4. 运行项目

打开 `application/app/src/main/kotlin/com/tencent/rtcube/v2/debug/GenerateTestUserSig.kt`,填入您自己的腾讯云 `SDKAPPID` 与 `SECRETKEY`,然后编译并运行 `app` 模块。

## 架构

`RTCube` 的架构设计遵循分层原则:

1. **TUILiveKit / TUICallKit / TUIRoomKit (UI 层):**

* 提供预制的、可复用的 UI 组件。
* 负责视图(View)的展示和用户交互。
* 订阅 `AtomicXCore` 中的 `Store` 来获取状态并更新 UI。
* 调用 `AtomicXCore` 中的 `Store` 方法来响应用户操作。

2. **AtomicXCore (核心层):**

* **Stores:** (如 `LiveListStore`, `CallListStore`, `ConversationListStore`) 负责管理业务逻辑和状态(State)。
* **Core Views:** (如 `LiveCoreView`, `ParticipantView`) 提供了驱动视频渲染的无 UI 视图容器。
* **Engine 封装:** 封装了底层的 `RTCRoomEngine`, `TUICallEngine` 和 `IMSDK`,提供统一的 API。

3. **Tencent Cloud SDK (引擎层):**

* `RTCRoomEngine` & `TUICallEngine`: 提供底层的实时音视频能力。
* `IMSDK`: 提供即时通讯能力。

## 文档

* [AtomicXCore 文档](https://tencent-rtc.github.io/TUIKit_Android/documentation/atomicxcore)
* [官方文档 - 快速集成指南](https://cloud.tencent.com/document/product/647/106536)

## 许可证

本项目遵循 [MIT 许可证](https://www.google.com/search?q=LICENSE)。

-----
95 changes: 95 additions & 0 deletions application/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,95 @@
# RTCube

English | [简体中文](README.cn.md)

## Overview

RTCube is a powerful UI component library built on top of the Tencent Cloud `AtomicXCore` SDK. `AtomicXCore` consolidates the core capabilities of Tencent Cloud Real-Time Communication (TRTC), Instant Messaging (IM), Audio/Video Calling (TUICallEngine), and Room Management (TUIRoomEngine), offering a state-driven API design.

On top of the core capabilities provided by `AtomicXCore`, RTCube delivers a set of ready-to-use user interfaces (UI), allowing you to quickly integrate interactive video live streaming, voice chat rooms, audio/video calling, and more into your Android application—without worrying about complex backend logic or state management.

## Features

Based on `AtomicXCore`, RTCube provides complete UI implementations for the following core business scenarios:

* **Video/Voice Live Streaming:**

* **Live List Management:** Fetch the list of live streams.
* **Go Live & Watch:** Create live rooms and join live streams.
* **Seat Management:** Manage seats; audience members can take or leave the mic.
* **Co-hosting:** Support cross-room co-hosting between hosts.
* **Host Battle (PK):** Support interactive PK between hosts.
* **Interactive Features:**
* **Gifts:** Send and receive gifts.
* **Likes:** Send likes in the live room.
* **Barrage (Danmaku):** Send and receive barrage messages.

* **Audio/Video Calling:**

* **Basic Calls:** Support 1v1 and multi-party audio/video calls.
* **Call Management:** Support answering, rejecting, and hanging up calls.
* **Device Management:** Control the camera and microphone during calls.
* **Call History:** Query and delete call records.

* **Multi-party Meetings (Room):**

* **Quick Meetings:** One-click creation and joining of multi-party meetings.
* **Invite to Meeting:** Invite members to join the current meeting.
* **In-meeting Controls:** Hosts can manage members' audio/video, seats, and member list.
* **Screen Sharing:** Support screen sharing during meetings.

## Quick Start

### 1. Prerequisites

* Android Studio Giraffe (2022.3.1) or later
* JDK 17
* Android Gradle Plugin 8.x
* Android 7.0 (API 24) or later

### 2. Clone the Repository

```bash
git clone https://github.com/Tencent-RTC/TUIKit_Android.git
```

### 3. Open the Project

Open `TUIKit_Android/application` with Android Studio and let Gradle sync the dependencies. All required AtomicXCore component modules (`tuilivekit`, `tuicallkit-kt`, `tuiroomkit`, etc.) are wired in through the top-level `settings.gradle`.

### 4. Configure & Run

Open `application/app/src/main/kotlin/com/tencent/rtcube/v2/debug/GenerateTestUserSig.kt`, fill in your Tencent Cloud `SDKAPPID` and `SECRETKEY`, then run the `app` module.

## Architecture

The architecture of `RTCube` follows a layered design:

1. **TUILiveKit / TUICallKit / TUIRoomKit (UI Layer):**

* Provides prebuilt, reusable UI components.
* Handles view presentation and user interaction.
* Subscribes to `Store`s in `AtomicXCore` to retrieve state and update the UI.
* Calls `Store` methods in `AtomicXCore` to respond to user actions.

2. **AtomicXCore (Core Layer):**

* **Stores:** (e.g., `LiveListStore`, `CallListStore`, `ConversationListStore`) Manage business logic and state.
* **Core Views:** (e.g., `LiveCoreView`, `ParticipantView`) Provide UI-less view containers that drive video rendering.
* **Engine Wrappers:** Wrap the underlying `RTCRoomEngine`, `TUICallEngine`, and `IMSDK`, providing a unified API.

3. **Tencent Cloud SDK (Engine Layer):**

* `RTCRoomEngine` & `TUICallEngine`: Provide low-level real-time audio/video capabilities.
* `IMSDK`: Provides instant messaging capabilities.

## Documentation

* [AtomicXCore Documentation](https://tencent-rtc.github.io/TUIKit_Android/documentation/atomicxcore)
* [Official Documentation - Quick Integration Guide](https://cloud.tencent.com/document/product/647/106536)

## License

This project is licensed under the [MIT License](https://www.google.com/search?q=LICENSE).

-----
1 change: 0 additions & 1 deletion application/app/.gitignore

This file was deleted.

149 changes: 122 additions & 27 deletions application/app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -2,28 +2,90 @@ apply plugin: 'com.android.application'
apply plugin: 'kotlin-android'

android {
namespace 'com.tencent.uikit.app'
namespace 'com.tencent.rtcube.v2'
compileSdk 34

defaultConfig {
applicationId "com.trtc.uikit.livekit.example"
minSdkVersion 21
targetSdkVersion 34
versionCode 1
versionName "1.0"
applicationId 'com.tencent.trtc'
minSdk 24
targetSdk 34
versionCode = ((project.findProperty('RTCUBE_VERSION_CODE') ?: '2') as String).toInteger()
versionName = (project.findProperty('RTCUBE_VERSION_NAME') ?: '2.0.0').toString()
testInstrumentationRunner 'androidx.test.runner.AndroidJUnitRunner'

ndk {
abiFilters 'arm64-v8a', 'armeabi-v7a'
}

manifestPlaceholders = [
// ioa party name, used for IOA integration; values injected from gradle.properties
ACCESS_PARTY_NAME: 'com_tencent_trtc',
// vivo / honor push identifier, used for TIMPush integration; values injected from gradle.properties
VIVO_APPKEY : (project.findProperty('RTCUBE_VIVO_APPKEY') ?: ''),
VIVO_APPID : (project.findProperty('RTCUBE_VIVO_APPID') ?: ''),
HONOR_APPID : (project.findProperty('RTCUBE_HONOR_APPID') ?: '')
]
}

signingConfigs {
release {
storeFile file("trtc.keystore")
storePassword "tencent.com"
keyAlias "tencent"
keyPassword "tencent.com"
}
}

buildTypes {
release {
signingConfig signingConfigs.release
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'
}
}

packagingOptions {
exclude '/META-INF/{AL2.0,LGPL2.1}'
exclude 'META-INF/LICENSE.txt'
exclude 'META-INF/NOTICE.txt'
flavorDimensions "channel"
productFlavors {
xiaomi {
dimension "channel"
applicationId "com.tencent.trtc"
}
rtcube {
dimension "channel"
applicationId "com.tencent.trtc"
}
tencentrtc {
dimension "channel"
applicationId "com.tencent.rtc.app"
}
rtcubelab {
dimension "channel"
applicationId "com.tencent.trtc"
isDefault true
}
}

sourceSets {
main {
res.srcDirs(
'src/main/res',
'src/main/res-main',
'src/main/res-mine',
'src/main/res-privacy',
'src/main/res-overseas'
)
}
}

buildFeatures {
viewBinding true
dataBinding true
buildConfig true
compose true
}

composeOptions {
kotlinCompilerExtensionVersion '1.5.8'
}

compileOptions {
Expand All @@ -32,24 +94,57 @@ android {
}

kotlinOptions {
jvmTarget = JavaVersion.VERSION_17
jvmTarget = '17'
}

lint {
error 'RtlHardcoded'
error 'RtlCompat'
error 'RtlEnabled'
}
}

dependencies {
api project(':tuicallkit-kt')
api project(':tuilivekit')
api project(':tuiroomkit')
api rootProject.getProperties().containsKey("common") ? rootProject.ext.common : "io.trtc.uikit:common:3.3.0.1194"
api project(':debug')

implementation("androidx.core:core:1.13.0")
implementation("androidx.appcompat:appcompat:1.6.1")
implementation "androidx.navigation:navigation-fragment:2.1.0"
implementation 'androidx.appcompat:appcompat:1.3.1'
implementation 'androidx.cardview:cardview:1.0.0'
debugImplementation 'com.squareup.leakcanary:leakcanary-android:2.14'

androidTestImplementation libs.androidx.junit
androidTestImplementation libs.androidx.espresso.core
}
implementation project(':login')
implementation project(':assembly')

implementation libs.androidx.core.ktx
implementation libs.androidx.appcompat
implementation libs.androidx.activity.ktx
implementation libs.androidx.fragment.ktx
implementation libs.androidx.constraintlayout
implementation libs.material

implementation libs.lifecycle.runtime.ktx

implementation libs.kotlinx.coroutines.android

implementation libs.okhttp
implementation libs.okhttp.logging
implementation libs.retrofit
implementation libs.retrofit.serialization
implementation libs.retrofit.gson

implementation libs.kotlinx.serialization.json

implementation libs.coil
implementation libs.coil.compose

implementation platform(libs.compose.bom)
implementation libs.compose.ui
implementation libs.compose.ui.tooling.preview
implementation libs.compose.material3
implementation libs.compose.foundation
implementation libs.compose.runtime
implementation libs.activity.compose
implementation libs.lifecycle.viewmodel.compose
implementation libs.lifecycle.runtime.compose
implementation libs.navigation.compose
debugImplementation libs.compose.ui.tooling
implementation 'com.journeyapps:zxing-android-embedded:4.3.0'

debugImplementation libs.leakcanary

// TIMPush
implementation 'com.tencent.timpush:timpush:latest.release'
}
Loading