Android

This document describes how to customize the UI of TUICallKit and provides two schemes for customization: slight UI adjustment and custom UI implementation.

Scheme One. Slight UI Adjustment

You can adjust the UI of TUICallKit by directly modifying the UI source code in the Android/tuicallkit folder in tencentyun/TUICallKit.

Replacing Icons

You can directly replace the icons in the res\drawable-xxhdpi folder to customize the color tone and style of all the icons in your application. When you replace an icon, make sure the filename is the same as the original icon.

img



Replacing Ringtones

You can replace ringtones by replacing the three audio files in the res\raw folder.
Filename
Purpose
phone_dialing.mp3
The sound of making a call
phone_hangup.mp3
The sound of being hung up
phone_ringing.mp3
The ringtone for incoming calls

Replacing Text

You can modify the strings on the video call UI by modifying the strings.xml file in values-zh and values-e.

Scheme Two. Custom UI Implementation

The entire call feature of TUICallKit is implemented based on the UI-less component TUICallEngine. You can delete the tuicallkit folder and implement your own UIs based entirely on TUICallEngine.

TUICallEngine

TUICallEngine is the underlying API of the entire TUICallKit component. It provides key APIs such as APIs for making, answering, declining, and hanging up one-to-one audio/video and group calls and device operations.
API
Description
Creates a TUICallEngine instance (singleton mode).
Terminates a TUICallEngine instance (singleton mode).
Init
Authenticates the basic audio/video call capabilities.
Registers an event listener.
Unregisters an event listener.
calls
Initiate a one-to-one or multi-person call.
join
Proactively join a call.
accept
Accepts a call.
reject
Rejects a call.
hangup
Ends a call.
ignore
Ignores a call.
Invites users to the current group call.
Subscribes to the video stream of a remote user.
Unsubscribes from the video stream of a remote user.
Turns the camera on.
Turns the camera off.
Switches between the front and rear cameras.
Turns the mic on.
Turns the mic off.
Selects the audio playback device (receiver or speaker).
Sets the alias and profile photo.
Sets whether to enable multi-device login for TUICallEngine (supported by the Group Call package).
Set the rendering mode of video image.
Set the encoding parameters of video encoder.
Advanced features.
Set beauty level, support turning off default beauty.

TUICallObserver

TUICallObserver is the corresponding callback event class of TUICallEngine. You can use it to listen on the desired callback events.
API
Description
onError
A call occurred during the call.
A call invitation was received.
The call was connected.
onCallEnd
The call ended.
The call not connected.
A user declined the call.
A user didn't respond.
A user was busy.
A user is invited to join a call.
A user joined the call.
A user left the call.
Whether a user had a video stream.
Whether a user had an audio stream.
The volume levels of all users.
The network quality of all users.
The current user was kicked offline.
The user sig is expired.

Definitions of Key Types

API
Description
TUICallDefine.MediaType
The call media type. Enumeration: Video call and audio call.
TUICallDefine.Role
The call role. Enumeration: Caller and callee.
TUICallDefine.Status
The call status. Enumeration: Idle, waiting, and answering.
TUICommonDefine.RoomId
The audio/video room ID, which can be a number or string.
TUICommonDefine.Camera
The camera type. Enumeration: Front camera and rear camera.
TUICommonDefine.AudioPlaybackDevice
The audio playback device type. Enumeration: Speaker and receiver.
TUICommonDefine.NetworkQualityInfo
The information of the current network quality.