This page introduces how to add Flexible Classroom into your Android app.
Flexible Classroom contains the following modules:
app
: (Optional) This module contains code for the classroom login interface and a client-side token generator, showing 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, showing how to call APIs to aggregate and update UI data. This module is an open-source project available on GitHub. You can develop your own classroom UI based on this module.AgoraClassSDK
: (Optional) This module provides methods for configuring the SDK, launching a flexible classroom, and registering ext apps, and provides 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.AgoraEduCore
is the required core module, and all the other modules depend on it.AgoraEduUIKit
and AgoraClassSDK
depend on AgoraEduCore
, and there is no dependency between them.AgoraEduUIKit
depends on hyphenate
.hyphenate
depends on AgoraEduCore
.app
depends on all other modules.Choose any of the following integration methods according to your needs.
If you use the default UI of Flexible Classroom, take the following steps to add remote dependencies and integrate the whole Flexible Classroom:
Add the following library in your project's build.gradle
file:
buildscript {
repositories {
maven { url 'https://jitpack.io' }
google()
mavenCentral()
}
}
allprojects {
repositories {
maven { url 'https://jitpack.io' }
google()
mavenCentral()
}
}
Add the following dependencies in the project's build.gradle
file to import four modules: AgoraEduUIKit
, AgoraClassSDK
, and AgoraEduCore
:
dependencies {
...
implementation "io.github.agoraio-community:hyphenate:2.0.0"
implementation "io.github.agoraio-community:AgoraEduCore:2.0.0"
implementation "io.github.agoraio-community:AgoraEduUIKit:2.0.0"
implementation "io.github.agoraio-community:AgoraClassSDK:2.0.0"
}
If you want to customize the default UI of Flexible Classroom, integrate Flexible Classroom as follows:
Run the following command to clone the CloudClass-Android project and check out the latest release branch.
git clone https://github.com/AgoraIO-Community/CloudClass-Android.git
git checkout release/apaas/x.y.z
After pulling the code, you can see the dependencies between the modules have been configured. If your app does not need to import all the modules, delete the unnecessary modules and ensure the dependencies remain correct. By default, the app
module imports and compiles all modules through implementation
, and the dependencies between other modules are imported by compileOnly
. If you delete the app
module, you need to rewrite the import method.
To customize the classroom UI, just edit the code in the AgoraEduUIKit
module.
No matter which method you choose, the third-party libraries used by Flexible Classroom may conflict with the third-party libraries on which your own project depends. You can use exclude
to resolve this conflict or change the version that your project depends on.