VMOS Cloud API
  • 简体中文
  • English
  • 简体中文
  • English
  • Product Introduction
  • Product Type
  • Product Billing
  • OpenAPI
    • User Guide
    • API Documentation
    • Error Code
    • Instance Property List
    • Android device modification attribute list
    • Callback Task Business Type Codes
    • Changelog
  • Android SDK
    • Example Construction
    • API Documentation
    • Callback Functions
    • Error Code
    • Changelog
  • Web H5 SDK
    • Example Build
    • API Documentation
    • H5 SDK Callback Functions
    • Error Code
    • Change log
  • Windows PC SDK
    • Example Setup
    • API Documentation
    • Callback Functions
    • Changelog
  • Edge-Cloud Communication Development
    • AIDL Integration Method
    • System Service API (AIDL)
  • Similar to XP, LSP Hook framework

    • Xposed-like / LSPosed Framework
    • Sensor Data Dynamic Simulation
  • 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 mode)
initInitialize engine
destoryDestroy engine
setSdkHostSet server address
createPhoneClientCreate cloud phone session for controlling cloud phone
createBatchControlVideoCreate batch streaming controller
getVideoDeviceListGet camera list
getAudioDeviceListGet microphone list

Multi-Control (GroupControl)

Interface NameDescription
destoryDestroy
startEventSyncEnable multi-control
stopEventSyncDisable multi-control
setEventSyncMasterSet master control
sendInputTextSend text to specified cloud phone input field
startVideoCaptureStart camera capture
stopVideoCaptureStop capture
getCameraCountGet camera count
getCameraInfoGet camera info

Batch Streaming (BatchControlVideo)

Interface NameDescription
startStart streaming
stopStop single streaming
stopStop batch streaming
stopAllStop all streaming
containsCheck if contains
subscribeStart subscription
unsubscribeCancel subscription
setVideoSinkSet video renderer
setBatchControlObserverSet callback

Main Stream (PhoneClient)

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

Detailed Interface Description

Get Engine Instance

Description: Get ArmcloudEngine instance

Signature:

static ArmcloudEngine* instance();

Parameters:

Parameter NameTypeRequiredDescription
appIdstringYesApp ID
logPathwstringNoLog file path
isInitEngineboolNoWhether 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 NameTypeRequiredDescription
appIdstringYesApp ID
logPathwstringNoLog file path
isInitEngineboolNoWhether 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 NameTypeRequiredDescription
hoststringYesServer 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 NameTypeRequiredDescription
configBatchPhoneConfigYesMulti-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 NameTypeRequiredDescription
podIdstringYesMaster 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 NameTypeRequiredDescription
podIdstringYesTarget cloud phone ID
contentstringYesText content (must be UTF-8 encoded)

Start Streaming (Batch)

Description: Start streaming

Signature:

void start(const BatchPhoneConfig& config);

Parameters:

Parameter NameTypeRequiredDescription
configBatchPhoneConfigYesBatch streaming config

Stop Streaming (Single)

Description: Stop streaming

Signature:

void stop(const std::string& podId);

Parameters:

Parameter NameTypeRequiredDescription
podIdstringYesCloud phone ID to stop streaming

Stop Batch Streaming

Description: Stop batch streaming

Signature:

void stop(const std::vector<std::string>& podList);

Parameters:

Parameter NameTypeRequiredDescription
podListstd::vectorstd::stringYesList 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 NameTypeRequiredDescription
podIdstringYesCloud phone ID to check

Start Subscription

Description: Start video stream subscription

Signature:

void subscribe(const std::string& podId);

Parameters:

Parameter NameTypeRequiredDescription
podIdstringYesCloud phone ID to subscribe

Cancel Subscription

Description: Cancel video stream subscription

Signature:

void unsubscribe(const std::string& podId);

Parameters:

Parameter NameTypeRequiredDescription
podIdstringYesCloud phone ID to unsubscribe

Set Video Renderer (Batch)

Description: Set video renderer

Signature:

void setVideoSink(const std::string& podId, VideoRenderSink* sink);

Parameters:

Parameter NameTypeRequiredDescription
podIdstringYesCloud phone ID
sinkVideoRenderSink*YesVideo renderer

Set Callback (Batch)

Description: Set batch control callback

Signature:

void setBatchControlObserver(BatchControlObserver* observer);

Parameters:

Parameter NameTypeRequiredDescription
observerBatchControlObserver*YesCallback

Start Streaming (Single)

Description: Start streaming

Signature:

void start(PhoneConfig& config);

Parameters:

Parameter NameTypeRequiredDescription
configPhoneConfigYesConnection 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 NameTypeRequiredDescription
sinkVideoRenderSink*YesVideo renderer

Set Cloud Phone Event Callback

Description: Set cloud phone event callback

Signature:

void setSessionObserver(SessionObserver* observer);

Parameters:

Parameter NameTypeRequiredDescription
observerSessionObserver*YesEvent 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 NameTypeRequiredDescription
actionintYesEvent type
xintYesX coordinate
yintYesY coordinate
widthintYesCloud phone screen width
heightintYesCloud phone screen height
swipeintYesScroll 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 NameTypeRequiredDescription
codeintYesKey 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 NameTypeRequiredDescription
actionintYesAction (0: DOWN, 1: UP)
codeintYesKey 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 NameTypeRequiredDescription
actionintYesAction (0: DOWN, 1: UP, 2: MOVE)
xintYesX coordinate
yintYesY coordinate
widthintYesCloud phone screen width
heightintYesCloud phone screen height

Change Stream Quality

Description: Set cloud phone stream quality

Signature:

void setVideoLevel(int resolution, int fps, int bitrate);

Parameters:

Parameter NameTypeRequiredDescription
resolutionintYesResolution 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)
fpsintYesFrame rate ID (1: 20fps, 2: 25fps, 3: 30fps, 4: 60fps, 5: 1fps, 6: 5fps, 7: 10fps, 8: 15fps, 9: 2fps)
bitrateintYesBitrate 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 NameTypeRequiredDescription
localboolNoSave 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 NameTypeRequiredDescription
textstringYesText content (UTF-8 encoded)

Enable Audio

Description: Audio enable switch

Signature:

void enableAudio(bool enable);

Parameters:

Parameter NameTypeRequiredDescription
enableboolYestrue: enable, false: disable

Enable Video

Description: Video enable switch

Signature:

void enableVideo(bool enable);

Parameters:

Parameter NameTypeRequiredDescription
enableboolYestrue: enable, false: disable

Enable Blow Gesture

Description: Blow gesture enable switch

Signature:

void enableBlow(bool enable);

Parameters:

Parameter NameTypeRequiredDescription
enableboolYestrue: 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 NameTypeRequiredDescription
cameraIdintYesCamera 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 NameTypeRequiredDescription
cmdstringYesADB command
Prev
Example Setup
Next
Callback Functions