This section describes how to implement an Android client for the students.
This flowchart shows the major logic of the students joining and leaving the classroom:
Integrate the SDK
Refer to the following table to download the SDKs, and integrate the SDKs into your project.
|Product||SDK download||Integration guide|
|RTC (Real-time Communication) SDK||Agora SDK for Android||Start a Live Broadcast|
|RTM (Real-time Messaging) SDK||Real-time Messaging SDK||Peer-to-peer or Channel Messaging|
|Whiteboard||White SDK||Whiteboard quickstart|
Core API call sequence
Refer to the following diagram to implement the basic real-time communication and messaging functions in your project with the Agora RTC SDK and RTM SDK.
Core API reference
- RTM SDK
|createInstance||Creates an RtmClient object.|
|login||Logs into the Agora RTM system.|
|createChannel||Creates an Agora RTM channel. You can create multiple channels with an RtmClient object.|
|join||Joins an Agora RTM channel.|
|getChannelAttributes||Gets the information of a specified channel.|
|queryPeersOnlineStatus||Queries the online status of a specified user.|
|ceateMessage||Creates an RtmMessage object.|
|sendMessageToPeer||Sends a peer-to-peer message. Use this method on the students' client to send the hands-up message.|
|setEnableNotificationToChannelMembers||Notifies all users in the RTM channel of the current channel information update. When the local channel information changes, all remote users receive the
|addOrUpdateChannelAttributes||Adds or Updates the information of a specified channel.|
|sendMessage||Sends a channel message, which can be received by all the users in the channel.|
|leave||Leaves the RTM channel.|
|logout||Logs out of the RTM system.|
- RTC SDK
|create||Creates an RtcEngine object.|
|setChannelProfile||Sets the channel profile. In a Lecture Hall, we set the channel profile as Live Broadcast.|
|setClientRole||Sets the user role in a live broadcast. In a Big Online Classroom, we set the role of students as audience before they join the channel. During the class, if the student gets the permission to speak up, we switch the user role to broadcaster.|
|joinChannel||Joins an Agora RTC channel.|
|setupRemoteVideo||Sets the remote video view. Call this method after the students join the channel, to configure the the view of the teacher on the students' client.|
|setupLocalVideo||Sets the local video view. Call this method after the student switches the user role to broadcaster, to configure the local view on the client.|
|leaveChannel||Leaves the RTC channel.|
For more features and functions available for an online class, you can refer to the following:
Monitor the network qualityUse the
onNetworkQualitycallback of the Agora RTC SDK to monitor the last-mile uplink and downlink network quality of every user in the channel. For more methods for reporting the real-time network quality, see the following guides:
Mute the local audio or videoCall the following methods provided by the Agora RTC SDK:
muteLocalAudioStream, to stop or resume sending the local audio stream.
muteLocalVideoStream, to stop or resume sending the local video stream.
Voice detectionFor RTC SDKs later than v2.9.2, you can enable voice detection by calling
enableAudioVolumeIndication, and setting the
true. Once enabled, the
onAudioVolumeIndicationcallback reports whether the local user is speaking in the
WhiteboardImplement the following whiteboard functions in your project:
Open-source demo project
Agora provides an open-source demo for Lecture Hall on GitHub to download as a source code reference.