Integrate Flexible Classroom
This page introduces how to add Flexible Classroom into your app.
Understand the tech
The following figure shows the overall technical architecture of Flexible Classroom:
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.hyphenate
: (Optional) The UI and logic of the chat feature implemented with the Hyphenate IM SDK. It is not required to import this module if you implement the chat feature on your own and letAgoraEduUIkit
rewrite the code related to the class message chat function in the module.
Module relations
AgoraEduCore
is the required core module, and all the other modules depend on it.- Both
AgoraEduUIKit
andAgoraClassSDK
depend onAgoraEduCore
, and there is no dependency between them. AgoraEduUIKit
depends onhyphenate
.hyphenate
depends onAgoraEduCore
.app
depends on all other modules.
Integrate Flexible Classroom through Maven
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 four modules:AgoraEduUIKit
,AgoraClassSDK
,AgoraEduCore
, andhyphenate
:To use Flexible Classroom versions equal to or earlier than 2.6.x, also add the
hyphenate
dependency inside thedependencies
block in the project'sbuild.gradle
file:Use the Maven repository search to find the latest version for each dependency. For example, type
io.github.agoraio-community:AgoraClassSDK
in the search box to find the latest version of theAgoraClassSDK
module. -
To launch a classroom, call AgoraClassroomSDK.setConfig and AgoraClassroomSDK.launch. Sample code:
-
To prevent code obfuscation, add the following in the
/Gradle Scripts/proguard-rules.pro
file:
See also
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.