This document describes the interfaces provided by the Cloud Phone PC Client SDK.
API Overview
Engine (ArmcloudEngine)
| Interface Name | Description |
|---|---|
| instance | Get engine instance (singleton mode) |
| init | Initialize engine |
| destory | Destroy engine |
| setSdkHost | Set server address |
| createPhoneClient | Create cloud phone session for controlling cloud phone |
| createBatchControlVideo | Create batch streaming controller |
| getVideoDeviceList | Get camera list |
| getAudioDeviceList | Get microphone list |
Multi-Control (GroupControl)
| Interface Name | Description |
|---|---|
| destory | Destroy |
| startEventSync | Enable multi-control |
| stopEventSync | Disable multi-control |
| setEventSyncMaster | Set master control |
| sendInputText | Send text to specified cloud phone input field |
| startVideoCapture | Start camera capture |
| stopVideoCapture | Stop capture |
| getCameraCount | Get camera count |
| getCameraInfo | Get camera info |
Batch Streaming (BatchControlVideo)
| Interface Name | Description |
|---|---|
| start | Start streaming |
| stop | Stop single streaming |
| stop | Stop batch streaming |
| stopAll | Stop all streaming |
| contains | Check if contains |
| subscribe | Start subscription |
| unsubscribe | Cancel subscription |
| setVideoSink | Set video renderer |
| setBatchControlObserver | Set callback |
Main Stream (PhoneClient)
| Interface Name | Description |
|---|---|
| start | Start streaming |
| stop | Stop streaming |
| setVideoSink | Set video renderer |
| setSessionObserver | Set cloud phone event callback |
| sendSwipe | Send scroll event |
| sendKeyCode | Send key event (complete DOWN+UP) |
| sendKeyCode | Send key event (single state) |
| volumeUp | Increase cloud phone volume |
| volumeDown | Decrease cloud phone volume |
| sendTouchEvent | Send touch event |
| setVideoLevel | Change stream quality |
| screenshot | Screenshot |
| sendInputText | Send input text |
| enableAudio | Enable audio |
| enableVideo | Enable video |
| enableBlow | Enable blow gesture |
| shake | Shake gesture |
| startVideoCapture | Start camera capture |
| stopVideoCapture | Stop capture |
| publishStream | Publish video stream |
| unPublishStream | Stop publishing |
| sendCommand | Send ADB command |
Detailed Interface Description
Get Engine Instance
Description: Get ArmcloudEngine instance
Signature:
static ArmcloudEngine* instance();
Parameters:
| Parameter Name | Type | Required | Description |
|---|---|---|---|
| appId | string | Yes | App ID |
| logPath | wstring | No | Log file path |
| isInitEngine | bool | No | Whether to initialize engine in advance |
Initialize Engine
Description: Initialize ArmcloudEngine
Signature:
bool init(const std::string& appId, const std::wstring& logPath = L"", bool isInitEngine = false);
Parameters:
| Parameter Name | Type | Required | Description |
|---|---|---|---|
| appId | string | Yes | App ID |
| logPath | wstring | No | Log file path |
| isInitEngine | bool | No | Whether to initialize engine in advance |
Destroy Engine
Description: Destroy ArmcloudEngine
Signature:
void destory();
Set Server Address
Description: Set server address
Signature:
void setSdkHost(const std::string& host);
Parameters:
| Parameter Name | Type | Required | Description |
|---|---|---|---|
| host | string | Yes | Server address |
Create Cloud Phone Session
Description: Create cloud phone session
Signature:
PhoneClient* createPhoneClient();
Create Batch Streaming Controller
Description: Create batch streaming controller
Signature:
BatchControlVideo* createBatchControlVideo();
Get Camera List
Description: Get camera list
Signature:
std::vector<DeviceInfo> getVideoDeviceList();
Get Microphone List
Description: Get microphone list
Signature:
std::vector<DeviceInfo> getAudioDeviceList();
Destroy
Description: Destroy
Signature:
void destory();
Enable Multi-Control
Description: Enable multi-control
Signature:
void startEventSync(const BatchPhoneConfig& config);
Parameters:
| Parameter Name | Type | Required | Description |
|---|---|---|---|
| config | BatchPhoneConfig | Yes | Multi-control config |
Disable Multi-Control
Description: Disable multi-control
Signature:
void stopEventSync();
Set Master Control
Description: Set master control
Signature:
void setEventSyncMaster(const std::string& podId);
Parameters:
| Parameter Name | Type | Required | Description |
|---|---|---|---|
| podId | string | Yes | Master cloud phone ID |
Send Text to Specified Cloud Phone Input
Description: Send text to specified cloud phone input field
Signature:
void sendInputText(const std::string& podId, const std::string& content);
Parameters:
| Parameter Name | Type | Required | Description |
|---|---|---|---|
| podId | string | Yes | Target cloud phone ID |
| content | string | Yes | Text content (must be UTF-8 encoded) |
Start Streaming (Batch)
Description: Start streaming
Signature:
void start(const BatchPhoneConfig& config);
Parameters:
| Parameter Name | Type | Required | Description |
|---|---|---|---|
| config | BatchPhoneConfig | Yes | Batch streaming config |
Stop Streaming (Single)
Description: Stop streaming
Signature:
void stop(const std::string& podId);
Parameters:
| Parameter Name | Type | Required | Description |
|---|---|---|---|
| podId | string | Yes | Cloud phone ID to stop streaming |
Stop Batch Streaming
Description: Stop batch streaming
Signature:
void stop(const std::vector<std::string>& podList);
Parameters:
| Parameter Name | Type | Required | Description |
|---|---|---|---|
| podList | std::vectorstd::string | Yes | List of cloud phone IDs to stop |
Stop All Streaming
Description: Stop all streaming
Signature:
void stopAll();
Check Contains
Description: Check if contains specified cloud phone
Signature:
bool contains(const std::string& podId);
Parameters:
| Parameter Name | Type | Required | Description |
|---|---|---|---|
| podId | string | Yes | Cloud phone ID to check |
Start Subscription
Description: Start video stream subscription
Signature:
void subscribe(const std::string& podId);
Parameters:
| Parameter Name | Type | Required | Description |
|---|---|---|---|
| podId | string | Yes | Cloud phone ID to subscribe |
Cancel Subscription
Description: Cancel video stream subscription
Signature:
void unsubscribe(const std::string& podId);
Parameters:
| Parameter Name | Type | Required | Description |
|---|---|---|---|
| podId | string | Yes | Cloud phone ID to unsubscribe |
Set Video Renderer (Batch)
Description: Set video renderer
Signature:
void setVideoSink(const std::string& podId, VideoRenderSink* sink);
Parameters:
| Parameter Name | Type | Required | Description |
|---|---|---|---|
| podId | string | Yes | Cloud phone ID |
| sink | VideoRenderSink* | Yes | Video renderer |
Set Callback (Batch)
Description: Set batch control callback
Signature:
void setBatchControlObserver(BatchControlObserver* observer);
Parameters:
| Parameter Name | Type | Required | Description |
|---|---|---|---|
| observer | BatchControlObserver* | Yes | Callback |
Start Streaming (Single)
Description: Start streaming
Signature:
void start(PhoneConfig& config);
Parameters:
| Parameter Name | Type | Required | Description |
|---|---|---|---|
| config | PhoneConfig | Yes | Connection config |
Stop Streaming (Single)
Description: Stop streaming
Signature:
void stop();
Set Video Renderer (Single)
Description: Set video renderer
Signature:
void setVideoSink(VideoRenderSink* sink);
Parameters:
| Parameter Name | Type | Required | Description |
|---|---|---|---|
| sink | VideoRenderSink* | Yes | Video renderer |
Set Cloud Phone Event Callback
Description: Set cloud phone event callback
Signature:
void setSessionObserver(SessionObserver* observer);
Parameters:
| Parameter Name | Type | Required | Description |
|---|---|---|---|
| observer | SessionObserver* | Yes | Event callback |
Send Scroll Event
Description: Send scroll event
Signature:
void sendSwipe(int action, int x, int y, int width, int height, int swipe);
Parameters:
| Parameter Name | Type | Required | Description |
|---|---|---|---|
| action | int | Yes | Event type |
| x | int | Yes | X coordinate |
| y | int | Yes | Y coordinate |
| width | int | Yes | Cloud phone screen width |
| height | int | Yes | Cloud phone screen height |
| swipe | int | Yes | Scroll distance |
Send Key Event (Complete DOWN+UP)
Description: Send key event (complete DOWN+UP). Recommended for system keys like Home, Back, Menu.
Signature:
void sendKeyCode(int code);
Parameters:
| Parameter Name | Type | Required | Description |
|---|---|---|---|
| code | int | Yes | Key code (3: HOME, 4: BACK, 82: MENU, 187: TASK) |
Send Key Event (Single State)
Description: Send key event (single state). Recommended for precise control (e.g., DELETE).
Signature:
void sendKeyCode(int action, int code);
Parameters:
| Parameter Name | Type | Required | Description |
|---|---|---|---|
| action | int | Yes | Action (0: DOWN, 1: UP) |
| code | int | Yes | Key code (3: HOME, 4: BACK, 82: MENU, 187: TASK) |
Increase Volume
Description: Increase cloud phone volume
Signature:
void volumeUp();
Decrease Volume
Description: Decrease cloud phone volume
Signature:
void volumeDown();
Send Touch Event
Description: Send touch event
Signature:
void sendTouchEvent(int action, int x, int y, int width, int height);
Parameters:
| Parameter Name | Type | Required | Description |
|---|---|---|---|
| action | int | Yes | Action (0: DOWN, 1: UP, 2: MOVE) |
| x | int | Yes | X coordinate |
| y | int | Yes | Y coordinate |
| width | int | Yes | Cloud phone screen width |
| height | int | Yes | Cloud phone screen height |
Change Stream Quality
Description: Set cloud phone stream quality
Signature:
void setVideoLevel(int resolution, int fps, int bitrate);
Parameters:
| Parameter Name | Type | Required | Description |
|---|---|---|---|
| resolution | int | Yes | Resolution ID (07: 144×256, 08: 216×384, 09: 288×512, 10: 360×640, 11: 480×848, 12: 540×960, 13: 600×1024, 14: 480×1280, 15: 720×1280, 16: 720×1920, 17: 1080×1920, 18: 1440×1920, 19: 1600×2560, 20: 2880×1080) |
| fps | int | Yes | Frame rate ID (1: 20fps, 2: 25fps, 3: 30fps, 4: 60fps, 5: 1fps, 6: 5fps, 7: 10fps, 8: 15fps, 9: 2fps) |
| bitrate | int | Yes | Bitrate ID (01: 1Mbps, 02: 1.5Mbps, 03: 2Mbps, 04: 2.5Mbps, 05: 3Mbps, 06: 3.5Mbps, 07: 4Mbps, 08: 5Mbps, 09: 6Mbps, 10: 8Mbps, 11: 10Mbps, 12: 12Mbps, 13: 200kbps, 14: 400kbps, 15: 600kbps) |
Screenshot
Description: Screenshot current cloud phone screen
Signature:
void screenshot(bool local);
Parameters:
| Parameter Name | Type | Required | Description |
|---|---|---|---|
| local | bool | No | Save location (true: local, false: cloud phone) |
Send Input Text
Description: Send text to replace cloud phone input field content (input field must be focused)
Signature:
void sendInputText(const std::string& text);
Parameters:
| Parameter Name | Type | Required | Description |
|---|---|---|---|
| text | string | Yes | Text content (UTF-8 encoded) |
Enable Audio
Description: Audio enable switch
Signature:
void enableAudio(bool enable);
Parameters:
| Parameter Name | Type | Required | Description |
|---|---|---|---|
| enable | bool | Yes | true: enable, false: disable |
Enable Video
Description: Video enable switch
Signature:
void enableVideo(bool enable);
Parameters:
| Parameter Name | Type | Required | Description |
|---|---|---|---|
| enable | bool | Yes | true: enable, false: disable |
Enable Blow Gesture
Description: Blow gesture enable switch
Signature:
void enableBlow(bool enable);
Parameters:
| Parameter Name | Type | Required | Description |
|---|---|---|---|
| enable | bool | Yes | true: enable, false: disable |
Shake Gesture
Description: Shake gesture
Signature:
void shake();
Start Camera Capture
Description: Start camera capture
Signature:
void startVideoCapture(int cameraId);
Parameters:
| Parameter Name | Type | Required | Description |
|---|---|---|---|
| cameraId | int | Yes | Camera ID |
Stop Capture
Description: Stop camera capture
Signature:
void stopVideoCapture();
Publish Stream
Description: Publish local camera video stream
Signature:
void publishStream();
Unpublish Stream
Description: Stop publishing local video stream
Signature:
void unPublishStream();
Send ADB Command
Description: Send ADB command
Signature:
void sendCommand(const std::string& cmd);
Parameters:
| Parameter Name | Type | Required | Description |
|---|---|---|---|
| cmd | string | Yes | ADB command |