VMOS Cloud API
  • 简体中文
  • English
  • 简体中文
  • English
  • Product Introduction
  • Product Type
  • Product Billing
  • OpenAPI
    • API Documentation
    • Error Code
    • Instance Property List
    • Android Device Modification Properties List
  • Android SDK
    • Example Construction
    • Interface Description
    • Callback Function
    • Error Code
    • Changelog
  • Web H5 SDK
    • Example Build
    • API description
    • Callback Functions
    • Error Code
    • Change log
  • Windows PC SDK
    • Example Setup
    • API Documentation
    • Callback Functions
    • Changelog
  • Edge-Cloud Communication Development
    • System service interface (aidl)
    • System Service API (AIDL)
  • Similar to XP, LSP Hook framework
  • Related agreements

This document describes the interfaces provided by the Cloud Phone PC Client SDK.

API Overview

Engine (ArmcloudEngine)

Interface NameDescription
instanceGet engine instance (singleton pattern)
initInitialize engine
destoryDestroy engine
setSdkHostSet server address
createPhoneClientCreate a cloud phone session for controlling the cloud phone
createBatchControlVideoCreate a batch streaming controller
getVideoDeviceListGet camera list
getAudioDeviceListGet microphone list

Group Control (GroupControl)

Interface NameDescription
destoryDestroy
startEventSyncStart group control
stopEventSyncStop group control
setEventSyncMasterSet master control
sendInputTextSend text to the specified cloud phone input box
startVideoCaptureStart camera capture
stopVideoCaptureStop capture
getCameraCountGet camera count
getCameraInfoGet camera information

Small Stream (BatchControlVideo)

Interface NameDescription
startStart streaming
stopStop streaming
stopBatch stop streaming
stopAllStop all streaming
containsCheck if included
subscribeStart subscription
unsubscribeUnsubscribe
setVideoSinkSet video renderer
setBatchControlObserverSet callback

Large Stream (PhoneClient)

Interface NameDescription
startStart streaming
stopStop streaming
setVideoSinkSet video renderer
setSessionObserverSet callback
sendSwipeSend scroll event
sendKeyCodeSend keyboard key event (send a complete DOWN+UP event)
sendKeyCodeSend keyboard key event (optionally send a single-state event)
volumeUpIncrease cloud phone device volume
volumeDownDecrease cloud phone device volume
sendTouchEventSend touch event
setVideoLevelChange streaming quality
screenshotTake a screenshot
sendInputTextSend input text
enableAudioEnable audio
enableVideoEnable video
enableBlowEnable blow feature
shakeShake feature
startVideoCaptureStart camera capture
stopVideoCaptureStop capture
publishStreamPublish video stream
unPublishStreamStop publishing
sendCommandSend ADB command

Detailed Interface Description

Get Engine Instance

Description: Get the ArmcloudEngine engine instance.

Syntax:

static ArmcloudEngine* instance();
ParameterTypeRequiredDescription
appIdstringYesSet log file path
logPathwstringNoLog file path
isInitEngineboolNoWhether to initialize the engine in advance

Initialize Engine

Description: Initialize the ArmcloudEngine engine.

Syntax:

bool init(const std::string& appId, const std::wstring& logPath = L"", bool isInitEngine = false);
ParameterTypeRequiredDescription
appIdstringYesSet log file path
logPathwstringNoLog file path
isInitEngineboolNoWhether to initialize the engine in advance

Destroy Engine

Description: Destroy the ArmcloudEngine engine.

Syntax:

void destory();

Set Server Address

Description: Set the server address.

Syntax:

void setSdkHost(const std::string& host);
ParameterTypeRequiredDescription
hoststringYesSet server address

Create Cloud Phone Session

Description: Creates a cloud phone session.

Syntax:

PhoneClient* createPhoneClient();

Create Batch Stream Controller

Description: Creates a batch stream controller.

Syntax:

BatchControlVideo* createBatchControlVideo();

Get Camera List

Description: Retrieves the list of cameras.

Syntax:

std::vector<DeviceInfo> getVideoDeviceList();

Get Microphone List

Description: Retrieves the list of microphones.

Syntax:

std::vector<DeviceInfo> getAudioDeviceList();

Destroy

Description: Destroys the instance.

Syntax:

void destory();

Start Group Control

Description: Starts group control.

Syntax:

void startEventSync(const BatchPhoneConfig& config);
ParameterTypeRequiredDescription
configBatchPhoneConfigYesGroup control configuration

Stop Group Control

Description: Stops group control.

Syntax:

void stopEventSync();

Set Master Control

Description: Sets the master control.

Syntax:

void setEventSyncMaster(const std::string& podId);
ParameterTypeRequiredDescription
podIdstringYesMaster cloud phone ID

Send Text to Cloud Phone Input Box

Description: Sends text to the specified cloud phone input box.

Syntax:

void sendInputText(const std::string& podId, const std::string& content);
ParameterTypeRequiredDescription
podIdstringYesMaster cloud phone ID
contentstringYesText content to send, must be UTF-8 encoded

Start Streaming

Description: Starts streaming.

Syntax:

void start(const BatchPhoneConfig& config);
ParameterTypeRequiredDescription
configBatchPhoneConfigYesBatch streaming configuration

Stop Streaming

Description: Stops streaming.

Syntax:

void stop(const std::string& podId);
ParameterTypeRequiredDescription
podIdstringYesCloud phone ID to stop streaming

Stop Streaming in Batch

Description: Stops streaming for multiple devices.

Syntax:

void stop(const std::vector<std::string>& podList);
ParameterTypeRequiredDescription
podListstring[]YesList of cloud phone IDs to stop streaming

Stop All Streaming

Description: Stops all streaming.

Syntax:

void stopAll();

Contains

Description: Checks if a cloud phone is included.

Syntax:

bool contains(const std::string& podId);
ParameterTypeRequiredDescription
podIdstringYesCloud phone ID to check

Start Subscription

Description: Starts a subscription.

Syntax:

void subscribe(const std::string& podId);
ParameterTypeRequiredDescription
podIdstringYesCloud phone ID to subscribe to video stream

Unsubscribe

Description: Cancels a subscription.

Syntax:

void unsubscribe(const std::string& podId);
ParameterTypeRequiredDescription
podIdstringYesCloud phone ID to unsubscribe from video stream

Set Video Renderer

Description: Sets the video renderer.

Syntax:

void setVideoSink(const std::string& podId, VideoRenderSink* sink);
ParameterTypeRequiredDescription
podIdstringYesCloud phone ID to set renderer
sinkVideoRenderSinkYesVideo renderer

Set Callback

Description: Sets the callback.

Syntax:

void setBatchControlObserver(BatchControlObserver* observer);
ParameterTypeRequiredDescription
observerBatchControlObserverYesCallback observer

Start Streaming

Description: Starts streaming.

Syntax:

void start(PhoneConfig& config);
ParameterTypeRequiredDescription
configPhoneConfigYesCloud phone connection configuration

Stop Streaming

Description: Stops streaming.

Syntax:

void stop();

Set Video Renderer

Description: Sets the video renderer.

Syntax:

void setVideoSink(VideoRenderSink* sink);
ParameterTypeRequiredDescription
sinkVideoRenderSink*YesVideo renderer

Set Cloud Phone Event Callback

Description: Call setSessionObserver() to set the cloud phone event callback.

Syntax:

void setSessionObserver(SessionObserver* observer)
ParameterTypeRequiredDescription
observerSessionObserver*YesEvent callback

Send Scroll Event

Description: Send a scroll event.

Syntax:

void sendSwipe(int action, int x, int y, int width, int height, int swipe)
ParameterTypeRequiredDescription
actionintYesEvent type
xintYesX-coordinate
yintYesY-coordinate
widthintYesWidth of the event area
heightintYesHeight of the event area
swipeintYesSwipe value

Send Key Event (Full Down + Up)

Description: Sends a complete DOWN+UP keyboard event to the cloud phone instance. Recommended for simulating system function keys like Home, Back, and Menu.

Syntax:

void sendKeyCode(int code)
ParameterTypeRequiredDescription
codeintYesKey code
3: HOME
4: BACK
82: MENU
187: TASK

Send Key Event (Single State)

Description: Sends a keyboard event to the cloud phone instance, allowing selection of single-state (DOWN or UP) events. Recommended for high-precision key events like DELETE.

Syntax:

void sendKeyCode(int action, int code)
ParameterTypeRequiredDescription
actionintYesKey action
0: DOWN
1: UP
codeintYesKey code
3: HOME
4: BACK
82: MENU
187: TASK

Increase Volume

Description: Increases the cloud phone device volume.

Syntax:

void volumeUp()

Decrease Volume

Description: Decreases the cloud phone device volume.

Syntax:

void volumeDown()

Send Mouse Click Event

Description: Sends a mouse click event.

Syntax:

void sendTouchEvent(int action, int x, int y, int width, int height)
ParameterTypeRequiredDescription
actionintYesClick action
0: DOWN
1: UP
2: MOVE
xintYesX-coordinate
yintYesY-coordinate
widthintYesLocal screen width
heightintYesLocal screen height

Adjust Stream Quality

Description: Sets the video resolution, FPS, and bitrate for cloud phone streaming.

Syntax:

void setVideoLevel(int resolution, int fps, int bitrate)
ParameterTypeRequiredDescription
resolutionintYesVideo resolution settings (e.g., 07: 144x256, 20: 2880x1080)
fpsintYesFrame rate settings (e.g., 1: 20fps, 9: 2fps)
bitrateintYesBitrate settings (e.g., 01: 1Mbps, 15: 600kbps)

Screenshot

Description: Captures a screenshot of the current cloud phone display.

Syntax:

void screenshot(bool local)
ParameterTypeRequiredDescription
localboolNoSave location
true: Local
false: Cloud phone

Send Input Text

Description: Sends text to replace the content in the cloud phone's input field (works only when the input field is focused).

Syntax:

void sendInputText(const std::string& text)
ParameterTypeRequiredDescription
textstringYesText to send (UTF-8 encoded)

Enable Audio

Description: Enables or disables audio.

Syntax:

void enableAudio(bool enable)
ParameterTypeRequiredDescription
enableboolYesState
true: Enable
false: Disable

Enable Video

Description: Enables or disables video.

Syntax:

void enableVideo(bool enable)
ParameterTypeRequiredDescription
enableboolYesState
true: Enable
false: Disable

Enable Blow Detection

Description: Enables or disables the "Blow Detection" feature.

Syntax:

void enableBlow(bool enable)
ParameterTypeRequiredDescription
enableboolYesState
true: Enable
false: Disable

Shake

Description: Simulates a shake gesture.

Syntax:

void shake()

Start Video Capture

Description: Starts video capture from a camera.

Syntax:

void startVideoCapture(int cameraId)
ParameterTypeRequiredDescription
cameraIdintYesCamera ID

Stop Video Capture

Description: Stops video capture.

Syntax:

void stopVideoCapture()

Publish Video Stream

Description: Publishes a video stream.

Syntax:

void publishStream()

Unpublish Video Stream

Description: Stops publishing a video stream.

Syntax:

void unPublishStream()

Send ADB Command

Description: Sends an ADB command to the cloud phone.

Syntax:

void sendCommand(const std::string& cmd)
ParameterTypeRequiredDescription
cmdstringYesADB command
Prev
Example Setup
Next
Callback Functions