1v1 Video Call | Group call |
| |
SDKAppID
and SDKSecretKey
, they will be used for the following steps.tuicallkit-kt
subdirectory in the Android
directory to the directory at the same level as app
in your current project, as shown below.settings.gradle.kts(or settings.gradle)
file in the project root directory and add the following code to import the tuicallkit-kt
component.include(":tuicallkit-kt")
include ':tuicallkit-kt'
build.gradle.kts
(or build.gradle
) file in the app
directory, add the following code to its dependencies
section. This is to declare the current app's dependency on the newly added components.dependencies {api(project(":tuicallkit-kt"))}
dependencies {api project(':tuicallkit-kt')}
TUICallKit
project depends on TRTC SDK
, Chat SDK
, tuicallengine
, and the tuicore
public library internally by default. To upgrade the version, modify the version in tuicallkit-kt/build.gradle
file.proguard-rules.pro
file in the app
directory. After adding, click on the upper right corner "Sync Now" to synchronize the code.-keep class com.tencent.** { *; }
AndroidManifest.xml
file and add tools:replace="android:allowBackup"
within the application node to override the settings inside the components, using your own settings.// app/src/main/AndroidManifest.xml<application android:name=".DemoApplication" android:allowBackup="false" android:icon="@drawable/app_ic_launcher" android:label="@string/app_name" android:largeHeap="true" android:theme="@style/AppTheme" tools:replace="android:allowBackup">
import com.tencent.qcloud.tuicore.TUILogin import com.tencent.qcloud.tuicore.interfaces.TUICallbackimport com.tencent.qcloud.tuikit.tuicallkit.debug.GenerateTestUserSigclass MainActivity : ComponentActivity() { override fun onCreate(savedInstanceState: Bundle?) { super.onCreate(savedInstanceState)// beginval userID = "denny" // Please replace with your UserIdval sdkAppID = 0 // Please replace with the SDKAppID obtained from the console in step 1val secretKey = "****" // Please replace with the SecretKey obtained from the console in step 1val userSig = GenerateTestUserSig.genTestUserSig(userId, sdkAppId, secretKey)TUILogin.login(this, sdkAppId, userId, userSig, object : TUICallback() {override fun onSuccess() {}override fun onError(errorCode: Int, errorMessage: String) {}})// end } }
import com.tencent.qcloud.tuicore.TUILogin; import com.tencent.qcloud.tuicore.interfaces.TUICallback;import com.tencent.qcloud.tuikit.tuicallkit.debug.GenerateTestUserSig;public class MainActivity extends AppCompatActivity { @Override public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState);//beginString userID = "denny"; // Please replace with your UserIdint sdkAppID = 0; // Please replace with the SDKAppID obtained from the console in step 1String secretKey = "****"; // Please replace with the SecretKey obtained from the console in step 1String userSig = GenerateTestUserSig.genTestUserSig(userId, sdkAppId, secretKey);TUILogin.login(this, sdkAppId, userId, userSig, new TUICallback() {@Overridepublic void onSuccess() {}@Overridepublic void onError(int errorCode, String errorMessage) {}});//end } }
Parameter | Type | Description |
userID | String | your own User ID based on your business. It can only include letters (a-z, A-Z), digits (0-9), underscores, and hyphens. |
sdkAppID | int | |
secretKey | String | |
userSig | String | A security signature for user login to verify identity and prevent unauthorized access to cloud services. |
GenerateTestUserSig.genTestSig
function to create a userSig. But be careful, the SDKSecretKey can be decompiled and reverse-engineered. If leaked, it could allow theft of your Tencent Cloud traffic.import com.tencent.qcloud.tuikit.tuicallengine.TUICallDefineimport com.tencent.qcloud.tuikit.tuicallkit.TUICallKit// Initiating a one-to-one audio call (assuming the callee's userID is mike)TUICallKit.createInstance(context).call("mike", TUICallDefine.MediaType.Audio)
import com.tencent.qcloud.tuikit.tuicallengine.TUICallDefine;import com.tencent.qcloud.tuikit.tuicallkit.TUICallKit;// Initiating a one-to-one audio call (assuming the callee's userID is mike)TUICallKit.createInstance(context).call("mike", TUICallDefine.MediaType.Audio);
Caller initiates an audio call | Callee receives an audio call request |
| |
info_rtc@tencent.com
.
Was this page helpful?