Development Environment Requirements
Android studio 3.0+
Android 4.4 (API 19) and later
Prerequisites
Step 1: Creating a New Application
1. Log in to the LCIC console, and select Quick Run in the left navigation bar. 2. You will enter the application creation page. Then check Create new application for the application type, and enter an application name, such as TestLCIC
.
If you have already created an application, you can also check "Select an existing application" for the application type.
Note:
To Integrate the Mobile client, you need to purchase the Premium or Enterprise edition. If a commercial application is needed, you can create a corresponding version of application according to business requirements on the purchase page. 3. Based on actual business requirements, add or edit tags, and then click Create.
Note:
Application names only support underscores, digits, or Chinese and English characters.
Tags are used to identify and organize various resources you possess within Tencent Cloud. For instance, an enterprise may include several business divisions, and each division may have 1 or more LCIC applications. In such cases, the enterprise can identify departmental information by assigning tags to the LCIC applications. Tags are not required. You can add or edit them based on actual business requirements.
Step 2: Acquiring the SDKAppId
and the Key (SecretKey
)
2. Log in to the CAM console to acquire the key. In case of no key, you must create a key in API Key Management. For details, refer to Key Management.
Step 3: Importing the SDK
Remote SDK Building for a Gradle Project
The LCIC SDK has been released to the Maven central repository. You can enable automatic downloading of updates through Gradle configuration.
1. In build.gradle
of the application module, add the LCIC SDK dependency to dependencies.
dependencies {
implementation 'com.tencent.edu:TCICSDK_LITE:1.8.9'
}
2. In defaultConfig
, specify the CPU architecture utilized by the Application.
defaultConfig {
ndk{
abiFilters "armeabi-v7a","arm64-v8a"
}
}
Note:
The LCIC SDK currently supports both armeabi-v7a and arm64-v8a architectures and can be flexibly configured based on business needs. Please note that the package size may vary when supporting different architectures.
3. In compileOptions
, specify JDK 1.8 for compilation.
compileOptions {
sourceCompatibility 1.8
targetCompatibility 1.8
}
4. Click Sync Now, to automatically download the SDK and integrate it into the project.
Step 4: Configuring Application Permissions
In the AndroidManifest.xml
, configure the application permissions. The LCIC SDK requires the following permissions:
<uses-permission android:name="android.permission.RECORD_AUDIO" />
<uses-permission android:name="android.permission.CAMERA" />
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" />
Step 5: Configuring Obfuscation Rules (Optional)
If obfuscation is enabled, you must add the LCIC SDK-related classes to the non-obfuscation list in the proguard-rules.pro
file.
-keep class com.tencent.** { *; }
Step 6: Applying for a License of the SDK
To apply for the SDK license, kindly send an email according to the template below to mediaservices@tencent.com to contact us. Upon confirmation we will issue the license within 1 business day.
Note:
The package name is used for signature authorization in the X5 kernel and the Live Event Broadcasting player. Send an email to provide the information such as App Name, Package Name, and Bundle ID of the official application requiring a license.
Recipient: mediaservices@tencent.com
Subject:
LCIC Android SDK License Application
Content:
Company Name: xxx Ltd.
Personal Name:
Contact Information:
App Name:
Package Name (Android):
Bundle ID (iOS):
Step 7: Initializing the X5 Kernel
Compared to the system WebView, the X5 kernel boasts superior compatibility and enhanced speed. The implementation of the LCIC Android SDK depends on the X5-based WebView. A method for static integration of the X5 kernel is now provided to increase the success rate of loading the X5 kernel, and it can take effect without the need to restart the process.
TCICManager.getInstance().initX5Core(licenseKey, new TBSSdkManageCallback() {
@Override
public void onCoreInitFinished() {
}
@Override
public void onViewInitFinished(boolean isX5Core) {
if (isX5Core) {
}
}
});
Note:
Currently, only 64-bit architecture integration is supported for global edition.
You must acquire the X5 kernel's licenseKey
, namely the licenseKey
parameter in TCICManager.getInstance().initX5Core(licenseKey);
by sending an email to contact us through Step 6. You should agree to the privacy policy before calling the method for initializing the X5 kernel, to avoid the collection of personal information without user consent when the application is launched in the app market.
Before entering the classroom, it is recommended to verify whether the X5 kernel has been successfully installed. The verification method is isX5InstallSuccess
.
Step 8: Acquiring the Parameters Necessary for Classroom Entry
TCICClassConfig Parameter Explanation:
1. Navigate to Application Management > Settings through the Console to acquire the SDKAppId, namely the school ID (schoolId
). 2. Create a classroom through the TencentCloud API CreateRoom, to obtain the classroom ID (classid
). 3. Register a user by calling the TencentCloud API RegisterUser, to acquire the corresponding user ID (userid
). 4. Log in through the TencentCloud API LoginUser, to acquire the user authentication token. 5. Parameters such as scene
, lng
, camera
, mic
, and speaker
are not required. if they are not specified, the default values are used.
|
schoolId | Integer | School ID | Navigate to Application Management > Settings through the console, to acquire the SDKAppId. | Yes |
classId | Long | Classroom ID | RoomId returned by creating a classroom through the CreateRoom API. | Yes |
userId | String | User account | | Yes |
token | String | Background authentication parameter | | Yes |
scene | String | Scenario name | Used to distinguish different custom layouts. It is configured through the SetAppCustomContent API. | No |
lng | String | Language parameter | Currently supports zh and en, zh by default. Additionally, you must set the lng parameter in TCICWebViewManager.getInstance().setClassLanuage(this, env, lng); . | No |
camera | Integer | Initializing and turning on the camera | 1 indicates turning on the camera, and 0 indicates turning off the camera. The default is 1. | No |
mic | Integer | Initializing and turning on the microphone | 1 indicates turning on the microphone, and 0 indicates turning off the microphone. The default is 1. | No |
speaker | Integer | Initializing and turning on the speaker | 1 indicates turning on the speaker, and 0 indicates turning off the speaker. The default is 1. | No |
Step 9: Initiating the Main Page of the Component
The main page of the LCIC component can be initiated by merely 4 parameters, respectively school ID, classroom ID, user account, and token.
Intent intent = new Intent(getActivity(), TCICClassActivity.class);
intent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK | Intent.FLAG_ACTIVITY_SINGLE_TOP);
Bundle bundle = new Bundle();
TCICClassConfig initConfig = new TCICClassConfig.Builder()
.schoolId(schoolId)
.classId(classId)
.userId(userId)
.token(token)
.build();
bundle.putParcelable(TCICConstants.KEY_INIT_CONFIG, initConfig);
intent.putExtras(bundle);
startActivity(intent);
If you want to receive a notice on exiting the classroom, you may register for the local broadcast of TCICConstants.ON_CLASS_EXITED_ACTION
, as shown in the following code snippet:
IntentFilter intentFilter = new IntentFilter();
intentFilter.addAction(TCICConstants.ON_CLASS_EXITED_ACTION);
LocalBroadcastManager.getInstance(context).registerReceiver(broadcastReceiver, intentFilter);
Other Recommendations
We suggest you to integrate Tencent Bugly when using LCICSDK, so that you can quickly identify and solve exceptions, keep abreast of product operation trends, and promptly address user feedback. For the integration guidance, refer to the Tencent Bugly Official Website.
Was this page helpful?