Menu

EDU SDK supporting agents

The EDU SDK supports eleven independent agents extended from BaseAgent governed by the AgentManager. Each agent has a dedicated role as seen below. Once an AgentManager is created, you can get each agent using the following API method:

 /** Create Instance of Agent Manager **/
 SamsungEducation samsungEducation = new SamsungEducation();
 try {
  samsungEducation.initialize(context);
 } catch (SsdkUnsupportedException e) {}
 AgentManager agentManager = AgentManager.getInstance();

 /** Example of Getting an agent **/
 SessionManageAgent sessionAgent = (SessionManageAgent) agentManager.getAgent(SessionManageAgent.class);

SessionManageAgent

The SessionManageAgent is responsible for managing the session status and user network connection status. SessionStatusListener is an interface for notifying session statuses. To get session updates, you need to register to this listener by using the registerListener(T listener) API method. You can get callbacks such as onSessionStarted, onSessionStopped, onUserJoinRequested, onUserJoined, onUserLeft, onNetworkDisconnected, and onNetworkReconnected. For more information, refer the Javadoc.

The following is the list of SessionManageAgent API methods:

API Description
registerListener(SessionStatusListener listener) Register Session Status Listener to Session Manage Agent for observing the session status.
unregisterListener(SessionStatusListener listener) Unregister Session Status Listener to SessionManageAgent.
startSession(String id, String name, String password,int timeout); Start a session using input manager's id and course name. Waits for the session started callback within timeout.

Synchronous method starts network and registers network callbacks. Also, makes a session instance to manage users.
stopSession(int timeout) Stop currently opened session. Waits for the closing session completed callback within the timeout period.

Synchronous method common for both manager and participant. Notifies participants about closure of session.
joinSession(String id, String name, String managerId, String managerName,String password, NetworkConnection netInfo, int timeout) Join opened session using input information. Opened sessions information can be obtained using Discovery Agent. Waits for the joining-completed callback within timeout.

Synchronous method for session participants.
acceptUser(String id) Accept a user for the Session Interaction.

When participant calls joinSession, manager can receive requester information in Session Status Listener. The manager can accept or reject that user.

This method is applicable only for Session Manager.
rejectUser(String id) Reject a user for the Session Interaction.

This method is only applicable for Session Manager.
expelUser(String id) Expel a particular user from the current session.
getSession() Gets the current session details such as Master ID, name, number of online participants, and so on.
isSessionRunning() Returns boolean for the current running session.

The following is a sample code to start a session:

AgentManager agentManager = AgentManager.getInstance();
SessionManageAgent sessionAgent = (SessionManageAgent)
agentManager.getAgent(SessionManageAgent.class);
sessionAgent.registeerListener(sessionStatusListener);
sessionAgent.StartSession(teacherId, teacherName, "1234", timeoutSecs);
/* If session is created */
@Override
public void onSessionStarted(boolean success, SessionException e) {
 if (success) {
  // Session started successfully
  // Inform to UI and then send course information 
 } else {
  // session started failed
 }
}

DeviceManageAgent

The DeviceManagerAgent provides APIs to manage the local and remote devices. Refer Javadoc for complete API list.

The following are the main functionalities provided by this agent:

  • Install package to local or remote devices
  • Uninstall package to local or remote devices
  • Request remote device information
  • Control brightness of local/remote devices
  • Control screen time out of local/remote devices
  • Control volume of local/remote devices
  • Set/clear wallpaper of local/remote devices
  • Enable/Disable GPS, Wi-Fi of local/remote devices
  • Enable/Disable device rotation of local/remote devices
  • Gets the total and free memory of local/remote devices

The following Listeners can be registered to this agent and get the respective callbacks:

  • InstalledApplicationListener — To listen for installed application list from a specific user.
  • DeviceRotationStatusListener — To listen for device rotation change
  • PackageInstallListener — To listen for package installation status like start, success, fail, and skip.
  • WallpaperFileDistributionListener — To listen for wallpaper sending status by the file sender.
  • DeviceStatusListener — To listen for device information like battery level, memory, rssi, ssid, bssid, and Wi-Fi link speed. The processed information is sent from session participants to master.
  • VolumeChangedListener: To listen for volume changes by master.
  • VolumeMutedUserChangedListener — To notify changes in the list of users muted by master.

Permissions required

  • Install/Uninstall package: android.permission.sec.MDM_APP_MGMT
  • Disallow install or uninstall app: android.permission.sec.MDM_RESTRICTION

ScreenShotAgent

The ScreenShotAgent is responsible for taking screen shots of local/remote devices. Refer Javadoc for complete API list.

The following are the main functionalities provided by this agent:

  • Get local screen data as bitmap image or save as file, and share it to recipients
  • Force to capture and save remote screen, and send it to required devices

ScreenShotResultListener notifies the user on screen shot results. ScreenShotFileSavedListener notifies both requester and sender about the result of forceToSaveScreenShot. ScreenShotFileReceivedListener notifies both requester and sender when screen file is received. ScreenShotFileDistributionListener notifies screen sender about screen image sending status.

Permissions required:

  • Screen capture - android.permission.sec.MDM_REMOTE_CONTROL
  • Read/write capture screen - android.permission.WRITE_EXTERNAL_STORAGE, android.permission.READ_EXTERNAL_STORAGE

DeviceLockAgent

The DevicelockAgent provides APIs to lock/unlock the remote devices and to get the lock status of the local and remote devices. Refer the Javadoc for complete API list.

The following are the main functionalities provided by this agent:

  • Application Lock: Apart from the allowed apps, other apps cannot be executed.
  • Screen Lock: Similar to Touch Lock, but some more information can be transferred.
  • Status Bar Lock: Notification and Status Bar can be locked.

Permissions required

The following permissions must be added in the application manifest to use the DeviceLockAgent APIs:

  • Application Lock : android.permission.sec.MDM_APP_MGMT
  • Status Bar Lock : android.permission.sec.MDM_KIOSK_MODE

The following Listeners can be registered with this agent to get the required callbacks:

  • DeviceLockedListener: Session participants who have registered DevicelockAgent to this listener are notified on device lock, while receiving the lock command.
  • UserLockStatusChangedListener: Changes in the lock status of the Session participants are notified through this listener.
  • AppLockedListener: Application lock status is notified through this listener.
  • AppLockedListChangedListener: Changes in the locked and allowed packages list are notified through this listener.

ScreenShareAgent

The ScreenShareAgent is responsible for transferring screen data to a single or many clients located in the same network. This agent supports 1:1, 1: N, and N: 1 screen sharing. Also, this agent captures sender screen and sends captured data to the intended recipients with the support of the following codecs:

  • H 264 codec - Hardware encoding and decoding with H.264 codec. Receiver displays received screen streaming data using Android surface.
  • Thumbnail (JPEG codec) - Thumbnail type sends image data encoded in JPEG codec. It is appropriate to send images of small size (bytes/kilobytes) and it supports 1:1, 1: N, and N: 1.
  • Screen codec - ICON software codec supported by the DMC Research center (not supported in Android SDK 23 and above)

When agent starts screen share, user has to set sender, receiver, and compressed codec. Sender and receiver are defined with the ScreenShareTarget class.

The above codec can be configured by the developer using Screen Share Type. ScreenShareListener and has to be registered by the developer for receiving decoded images. Supported image type and quality can be checked using IMAGE_TYPE and IMAGE_QUALITY.

ScreenShareListener is available for the users to register and get notified on Screen Sharing status. Refer Javadoc for complete API list.

The following are the main functionalities provided by this agent:

  • Receiver receives bitmap image periodically.
  • Supported image codec type can be defined while starting screen share.
  • Image quality and image capture frequency can be defined based on the need.

Permissions required:

  • android.permission.READ_FRAME_BUFFER
  • com.samsung.android.knox.permission.KNOX_REMOTE_CONTROL

DiscoveryAgent

The DiscoveryAgent is responsible to broadcast and receive network information from the devices connected to the same sub-network. Session participants should register to SessionInfoAnnouncedListener to get the callbacks on session announce information. The SessionAnnounceInfo contains session and network connection information.

The DiscoveryAgent provides the following discovery methods:

  • Wi-Fi multicast: Fast and simple to announce, and receive session information.
  • BLE: Device can advertise and scan session information through BLE.

The following is the list of DiscoveryAgent API methods:

API Description
setDiscoveryMethod(DiscoveryMethod discoveryMethod) Sets one discovery method like Wi-Fi multicast or BLE
startAnnouncingSession(SessionAnnounceInfo sessionInfo) Session master starts broadcasting the session information
stopAnnouncingSession() Stops announcing the session information
setAnnounceSessionInfoListener(SessionInfoAnnouncedListener listener) Sets the SessionInfoAnnouncedListener to listen for session information
startReceivingSession() Session participants start receiving session information
stopReceivingSession() Session participants stop receiving session information
getAnnouncedSessionInfo() Get the latest announced session list
isAnnouncingSessionInfo() Checks whether master is announcing the session
isReceivingSessionInfo() Checks whether participant is receiving the session

Permissions required

  • Wi-Fi multicast: android.permission.CHANGE_WIFI_MULTICAST_STATE
  • BLE : android.permission.BLUETOOTH, android.permission.BLUETOOTH_ADMIN

The following is a sample code for sending course information:

AgentManager agentManager = AgentManager.getInstance();
DiscoveryAgent discoveryAgent = (DiscoveryAgent)
agentManager.getAgent(DiscoveryAgent.class);
SessionAnnounceInfo sessionInfo = new SessionAnnounceInfo();
sessionInfo.sessionName = courseNameEdit.getText().toString();

try {
 discoveryAgent.setDiscoveryMethod(DiscoveryMethod.DISCOVERY_ON_WIFI);
 discoveryAgent.startAnnouncingSession(sessionInfo);
} catch (Exception e) {
 e.printStackTrace();
}

DeviceControlAgent

The DeviceControlAgent provides APIs to control the remote device. Refer Javadoc for complete API list.

The following are the main functionalities provided by this agent:

  • Launch the app to remote device(s)
  • Launch the URL to remote device(s)
  • Remotely dispatch the touch events to the device(s)
  • System power off and reboot of remote device(s)

Permissions required:

The following permissions must be added in the application manifest to use the Device Control APIs:

  • android.permission.sec.MDM_REMOTE_CONTROL
  • android.permission.sec.MDM_APP_MGMT
  • android.permission.sec.MDM_SECURITY

ApplicationLaunchedListener must be registered by session recipients for listening to the application launches, that are launched by the session master’s command. To get the app launch callbacks, you must register this listener using the API method setApplicationLaunchedListener(DeviceControlAgent.ApplicationLaunchedListener listener).

EventShareAgent

The EventShareAgent is responsible to sync events to remote devices. It includes notification and event share operations. Refer Javadoc for complete API list.

Following are the main functionalities provided by this agent:

  • Event Share : Get event from Calendar, add the event and share with participants. To use this feature, account registration should be done successfully.
  • Notification : Send the notifications. The sent notifications are added in participant's notification bar.

EventTimeInfo is the event information data class which is used to hold event time information details.

The following Listeners can be registered to this agent and get the respective callbacks:

  • EventReceivedListener: Event receiver gets notified about remotely received event information and saved result.
  • NotificationReceivedListener: An alert callback for any event notification arrival.
  • QueryResultListener: Callback for master and participants to notify event query result.

Permissions required:

  • Read and write events: android.permission.READ_CALENDAR, android.permission.WRITE_CALENDAR

FileShareAgent

The FileShareAgent is responsible to send one or multiple files between connected devices. This agent is built on top of FTP (File Transfer Protocol). Also, this agent uses the distributed file transferring approach for better performance, balanced load, and faster file transfers.

FileTransferListener is used to notify the receivers of the incoming file transfer transactions. It also provides regular notifications such as how much file data is transferred to both receiver and sender. Application developers must implement FileShareListener for file sender.

The following are the main functionalities provided by this agent:

  • Send files to multiple remote devices
  • Conditional send file check. For example, check if the same file is already available at the receivers end.
  • Cancel file send
  • Pause/Resume files transfer
  • Notify file share status
  • Notify failed transactions to the sender

The receiver can set the storage directory where files transferred through FTP are stored. If the storage directory is not set, then the files shared by FILESHARE is saved in ENVIRONMENT_ROOT_DIRECTORY/FILE_SHARE (for example: - “/storage/emulated/0/FILE_SHARE”.).

The FileShareAgent sends a file to the receiver if the receiver does not have the file in the storage directory. The FileShareManager employs an efficient check mechanism which checks if the file is already existing in the client default upload path. Based on that, it takes up a call to upload the file.

By registering to the Send File Listener, the FileShareManager notifies the File Send Status, Bytes Transferred status, and Timer Information.

Permissions required:

  • android.permission.READ_EXTERNAL_STORAGE
  • android.permission.WRITE_EXTERNAL_STORAGE

MediaAgent

The MediaAgent is responsible for sending audio/video data (1:1 and 1: N) to devices located in the same network and play together synchronously. Refer Javadoc for complete API list.

The following are the main functionalities provided by this agent:

  • Server sends audio to clients while recording a voice. Clients can play the received audio file synchronously.
  • Recorded audio is saved as raw audio data (PCM format).
  • Transmission of audio/video files to remote devices and the ability to play the same file once transfer is completed.

File receivers registering to VideoPlayListener receives callbacks on video playback status. File senders registering to MediaFileDistributionListener receives callback on file sending status.

Permissions required:

  • android.permission.RECORD_AUDIO
  • android.permission.WRITE_EXTERNAL_STORAGE

LicenseManageAgent

The LicenseManageAgent provides API methods to activate licenses and get RO values from server, which can be used under required permissions. LicenseActivationListener is an interface which provides license activation result after communicating with the MDM server.

The following are the main functionalities provided by this agent:

  • Activate license
  • Receive license activation result

The following is the list of LicenseManageAgent API methods:

API Description
activateLicense(String licenseKey, LicenseActivationListener licenseActivationListener) Method to activate license with input license key. This is done at the first launch of application. Internet is required to reach the MDM server
isLicenseActivated() Checks whether the license is activated