Listener Interfaces
| Interface Name | Interface Description |
|---|---|
| ICloudCoreManagerStatusListener | Initialization listener |
| IPlayerListener | Stream playback status listener |
| IStreamListener | Video stream status listener |
| StreamProfileChangeCallBack | Resolution change success listener |
| SetAutoRecycleTimeCallback | Idle recycle service time listener |
| ScreenShotCallBack | Local screenshot listener |
| LocationEventListener | Location listener |
| IMessageReceiver | Message passthrough listener |
| IUploadFileCallBack | File upload listener |
| IClipBoardListener | Cloud phone clipboard listener |
| IExecuteAdbCommandCallback | ADB command execution result listener |
Initialization Listener
Interface: ICloudCoreManagerStatusListener
Methods:
| Method Name | Parameters | Description |
|---|---|---|
| onPrepared() | None | Initialization success callback |
Stream Playback Status Listener
Interface: IPlayerListener
Methods:
| Method Name | Parameters | Description |
|---|---|---|
| onPlaySuccess(videoStreamProfileId: Int) | videoStreamProfileId: Current cloud phone resolution | Triggered when the first frame is rendered to the screen (playback success) |
| onError(code: Int, msg: String) | code: Error code; msg: Error message | Error information |
| onWarning(code: Int, msg: String) | code: Warning code; msg: Warning message | Warning information |
| onNetworkChanged(type: Int) | type: -1: Unknown network type; 0: Network disconnected; 1: LAN; 2: Wi-Fi (including hotspot); 3: 2G mobile; 4: 3G mobile; 5: 4G mobile; 6: 5G mobile | Network type and status change callback |
| onServiceInit(extras: Map<String, Any>?) | extras: Reserved parameters for passing additional data | Called before joining the room; used to obtain and initialize various services (e.g., setting event listeners) |
| networkQualityRtt(rtt: Int) | rtt: Round-trip time for data between client and server | After joining the room and publishing/subscribing streams, reports local and remote user network quality every 2 seconds |
| onMultiCloudPhoneJoin(padCode: String) | padCode: Cloud phone identifier | In multi-control mode, callback when a cloud phone joins the group |
| onMultiCloudPhoneLeave(padCode: String) | padCode: Cloud phone identifier | In multi-control mode, callback when a cloud phone leaves the group |
Video Stream Status Listener
Interface: IStreamListener
Methods:
| Method Name | Parameters | Description |
|---|---|---|
| onFirstAudioFrame(uid: String) | uid: Remote instance video stream ID | Callback when first audio frame is received after subscribing to stream |
| onRemoteAudio(byteBuffer: ByteBuffer) | byteBuffer: Audio stream data | Remote audio stream data |
| onFirstRemoteVideoFrame(uid: String, width: Int, height: Int) | uid: Remote instance video stream ID width: Cloud phone screen width height: Cloud phone screen height | Callback when first video frame is received after subscribing to stream |
| onVideoSizeChanged(uid: String, width: Int, height: Int) | uid: Remote instance video stream ID width: Cloud phone screen width height: Cloud phone screen height | Callback when cloud phone screen resolution changes |
| onStreamPaused() | None | Callback after calling pause() to pause playback |
| onStreamConnectionStateChanged(state: Int) | state@ConnectionState: Video stream connection state | Video stream connection state change callback |
| onScreenRotation(rotationType: String) | rotationType: TYPE_LANDSCAPE (landscape), TYPE_PORTRAIT (portrait) | Callback when cloud phone screen rotates |
Resolution Change Success Listener
Interface: StreamProfileChangeCallBack
Methods:
| Method Name | Parameters | Description |
|---|---|---|
| onVideoStreamProfileChange(isSuccess: Boolean, from: String, current: String) | isSuccess: Whether resolution switch succeeded from: Previous resolution current: Current resolution | Resolution change callback |
Idle Recycle Service Time Listener
Interface: SetAutoRecycleTimeCallback
Methods:
| Method Name | Parameters | Description |
|---|---|---|
| onResult(autoRecycleTime: Int) | autoRecycleTime: Idle recycle time in seconds | Callback triggered when idle time reaches the set duration |
Local Screenshot Listener
Interface: ScreenShotCallBack
Methods:
| Method Name | Parameters | Description |
|---|---|---|
| onScreenShot(bitmap: Bitmap) | bitmap: Bitmap of captured cloud phone screen | Callback after taking screenshot to local |
Location Listener
Interface: LocationEventListener
Methods:
| Method Name | Parameters | Description |
|---|---|---|
| onReceivedRemoteLocationRequest(requestOptions: RequestOptions) | options: Location request options | In manual location mode, callback when receiving location request from cloud phone |
| onRemoteLocationRequestEnded() | None | In manual location mode, when cloud phone ends location request |
| onSentLocalLocation(locationInfo: LocationInfo) | locationInfo: Location information | In auto location mode, callback after sending local device location to cloud phone |
| onRemoteLocationUpdated(locationInfo: LocationInfo) | locationInfo: Location information | Callback after cloud phone location is updated |
Message Passthrough Listener
Interface: IMessageReceiver
Methods:
| Method Name | Parameters | Description |
|---|---|---|
| onReceiveMessage(message: String) | message: Passthrough message body | Passthrough message sent from cloud phone |
File Upload Listener
Interface: IUploadFileCallBack
Methods:
| Method Name | Parameters | Description |
|---|---|---|
| onUpdateStart() | None | Upload started |
| onUpdateByteChange(totalByte: Long, updateByte: Long) | totalByte: Total file size updateByte: Current uploaded size (bytes) | Callback when uploaded bytes change |
| onUpdateProgressChange(progress: Int) | progress: Upload progress | Callback when upload progress changes (0 ~ 100) |
| onUpdateSuccess(mapData: Map<String, String>) | mapData: Reserved data | File upload succeeded |
| onUpdateFail(e: Throwable?) | e: Error information | File upload failed |
| onUpdateEnd() | None | Upload ended |
| onError(code: Int, msg: String) | code: Error code msg: Error message | Upload failed due to errors other than file upload issues |
Cloud Phone Clipboard Listener
Interface: IClipBoardListener
Methods:
| Method Name | Parameters | Description |
|---|---|---|
| onClipBoardMessageReceived(data: String) | data: Clipboard data synced from cloud phone | Clipboard data synced from cloud phone |
ADB Command Execution Result Listener
Interface: IExecuteAdbCommandCallback
Methods:
| Method Name | Parameters | Description |
|---|---|---|
| onExecuteAdbCommandResult(isSuccess: Boolean, content: String) | isSuccess: Whether execution succeeded content: Execution result | ADB command execution result listener |