Classroom SDK & Proctor SDK
This page introduces how to add Flexible Classroom into your app.
Understand the tech
Module introduction
The source code of Flexible Classroom contains the following packages:
app
: (Optional) This module contains code for the classroom login interface and a client-side token generator and shows how to call APIs to join a flexible classroom. This module is an open-source project available on GitHub and for reference only.
AgoraEduUIKit
: (Optional) This module contains code for the classroom UI. It shows how to call APIs to aggregate and update UI data based on Flexible Classroom APIs and data callbacks. This module is an open-source project available on GitHub. You can develop your classroom UI based on this module.AgoraClassSDK
: (Optional) This module provides methods to configure the SDK, launch a flexible classroom, register ext apps, and the activity implementation of each teaching scenario. This module is an open-source project available on GitHub. Agora recommends integrating this module.AgoraEduCore
: (Required) The core module of Flexible Classroom. Since v2.0.0, this module is closed-source, and you can import this module only by adding a remote dependency.AgoraCloudScene
: (Optional) The cloud classroom module of the Flexible Classroom. Depends on theAgoraEduCore
cloud classroom UI implementation of the module.
Integrated education scenario
If you use the default UI of Flexible Classroom, take the following steps to add remote dependencies and integrate the whole Flexible Classroom through Maven:
-
Add the following library to your project's
build.gradle
file: -
Add the following dependencies in the project's
build.gradle
file to import the following modules:AgoraEduUIKit
,AgoraClassSDK
, andAgoraEduCore
:For example, for v2.8.20:
To use Flexible Classroom versions equal to or earlier than 2.7.0, also add the
hyphenate
dependency inside thedependencies
block in the project'sbuild.gradle
file:InformationClick here to view the latest version of Flexible Classroom. -
After version 2.8.70, the following code needs to be initialized in the Application
onCreate
method: -
To launch a classroom, call AgoraClassroomSDK.launch. Sample code:
You can set the video parameters of the large and small windows by setting
FcrStreamParameters
, where:- Small stream mode: When in the stage area, switch to the small stream mode. This parameter indicates the video parameters in the stage area.
- Large stream mode: When in the large window area, switch to the large stream mode. This parameter indicates the video parameters in the large window.
-
Set up dark mode
Because switching to the dark mode requires restarting the Activity, in order to be compatible with all mobile phone models, it is recommended to set the theme directly in
Application#onCreate
. Refer to the following sample code: -
To prevent code obfuscation, add the following in the
/Gradle Scripts/proguard-rules.pro
file:
Integrated cloud classroom
If you use the default UI of Flexible Classroom Cloud Classroom, take the following steps to add remote dependencies and integrate the whole Flexible Classroom through Maven:
-
Add the following code to the
build.gradle
file in the project root directory: -
Add the following dependencies to the
build.gradle
file in the project root directory. ImportAgoraCloudScene
andAgoraEduCore
module:For example, for version 2.8.70:
InformationClick here to view the latest version of Flexible Classroom. -
In the Application
onCreate
method, initialize the following: -
Call AgoraOnlineClassroomSDK.launch to start the class. The parameters of
AgoraOnlineClassroomSDK
andAgoraClassroomSDK
are the same. Refer to the following sample code: -
To prevent code obfuscation, add the following in the
/Gradle Scripts/proguard-rules.pro
file:
Integration considerations
Third-party libraries
No matter which method you choose, the third-party libraries Flexible Classroom uses may conflict with the third-party libraries on which your project depends. You can use exclude
to resolve this conflict or change the version that your project depends on.