ARMCLOUD Documentation Center
  • 简体中文
  • English
  • 简体中文
  • English
  • Product introduction
  • Product billing
  • Server OpenAPI
    • Usage Guide
    • API Signature v1.0
    • API Reference
    • Error Codes
    • Callback Business Type Codes
    • Instance List
    • Android Instance Property List
    • Changelog
  • Android SDK
    • Example Setup
    • Interface Description
    • Callback Function
    • Error Code
    • Changelog
  • Web H5 SDK
    • Example Setup
    • Interface Description
    • Callback Function
    • Error Code
    • Changelog
  • Windows PC SDK
    • Example Setup
    • Interface Description
    • Callback Function
    • Changelog
  • Edge-Cloud Communication Development
    • AIDL Access Method
    • System Service API (AIIDL)
  • Scenario solutions
    • XP-like LSP Hook framework
    • Dynamic simulation of sensor data
  • ADI Collection Tool
  • FAQ
    • Platform Basics
    • Storage
    • Network Connectivity
    • Application Management
    • Development and Integration
    • Performance Optimization
    • Billing
    • Technical Support
  • Related agreements
    • Cloud Phone SDK Privacy Policy

This document describes the interface provided by the Cloud Phone PC client SDK.

API Overview

Engine (ArmcloudEngine)

Interface nameInterface description
[instance] (#get-the-engine-instance)Obtain engine instances (Singleton mode)
[init] (#initialize-the-engine)Initialize the engine
[destory] (#destroy-the-engine)Destroy the engine
[setSdkHost] (#set-the-server-address)Set the server address
[createPhoneClient] (#create-cloud-machine-talk)Create a cloud phone to operate the cloud phone
[createBatchControlVideo] (#create-a-batch-pull-controller)Create a batch pull controller
[getVideoDeviceList] (#get-a-list-of-cameras)Get a list of cameras
[getAudioDeviceList] (#get-a-list-of-microphones)Get a list of microphones

Group Control

Interface nameInterface description
[destory] (#destruction)Destruction
[startEventSync] (#activate-group-control)Activate group control
[stopEventSync] (#stop-mass-control)Stop mass control
[setEventSyncMaster] (#set-up-the-main-controller)Set up the main controller
[sendInputText] (#send-text-to-the-specified-cloud-machine-input-box)Send text to the specified cloud phone input box
[startVideoCapture] (#enable-camera-capture)Enable camera capture
[stopVideoCapture] (#stop-collecting)Stop collecting
[getCameraCount] (#get-the-number-of-cameras)Get the number of cameras
[getCameraInfo] (#obtain-camera-information)Obtain camera information

Xiaoliu (BatchControlVideo)

Interface nameInterface description
[start] (#start-pulling-traffic)Start pulling traffic
[stop] (#stop-pulling-flow)Stop pulling flow
[stop] (#batch-stopping-flow-pulling)Batch stopping flow pulling
[stopAll] (#stop-all-the-flow-pulling)Stop all the flow pulling
[contains] (#is-it-included)Is it included?
[subscribe] (#start-subscribing)Start subscribing
[unsubscribe] (#unsubscribe)Unsubscribe
[setVideoSink] (#set-up-the-video-renderer)Set up the video renderer
[setBatchControlObserver] (#set-callbacks)Set callbacks

Major Flow (PhoneClient)

Interface nameInterface description
[start] (#start-pulling-streams)Start pulling streams
[stop] (#stop-pulling-flow)Stop pulling flow
[setVideoSink] (#set-up-the-video-renderer)Set up the video renderer
[setSessionObserver] (#set-up-cloud-phone-event-callbacks)Set callbacks
[sendSwipe] (#send-a-scroll-event)Send a scroll event
[sendKeyCode] (#send-key-events)Send a keyboard key event (send a full DOWN+UP event)
[sendKeyCode] (#send-key-events)Send keyboard key events (optionally send single status events)
[volumeUp] (#turn-up-the-volume)Increase the volume of cloud phone equipment
[volumeDown] (#turn-down-the-volume)Reduce the volume of cloud devices
[sendTouchEvent] (#send-a-touch-event)Send a touch event
[setVideoLevel] (#modify-the-streaming-quality)Modify the streaming quality
[screenshot] (#screenshot)Screenshot
[sendInputText] (#send-input-text)Send input text
[enableAudio] (#turn-on-audio)Turn on audio
[enableVideo] (#start-the-video)Start the video
[enableBlow] (#open-it-and-blow-on-it)Open it and blow on it
[shake] (#shake-it-a-little)Shake it a little
[startVideoCapture] (#enable-camera-capture)Enable camera capture
[stopVideoCapture] (#stop-collecting)Stop collecting
[publishStream] (#release-video-streams)Release video streams
[unPublishStream] (#stopped-publishing)Stopped publishing
[sendCommand] (#send-the-adb-command)Send the adb command

Detailed interface description

Get the engine instance

Description: Obtain an ArmcloudEngine instance

Syntax:

static ArmcloudEngine* instance();
ParametersTypeIs it required?Description
appIdstringYesSet the log file path
logPathwstringNolog file path
isInitEngineboolNoWhether to initialize the engine in advance

Initializing the engine

Description: Initialize the ArmcloudEngine engine

Syntax:

bool init(const std::string& appId, const std::wstring& logPath = L"", bool isInitEngine = false);
ParametersTypeIs it required?Description
appIdstringYesSet the log file path
logPathwstringNolog file path
isInitEngineboolNoWhether to initialize the engine in advance

Destroy the engine

Description: Destroy the ArmcloudEngine engine

Syntax:

void destory();

Set the server address

Description: Set the server address Syntax:

void setSdkHost(const std::string& host);
ParametersTypeIs it required?Description
hoststringYesSet the server address

Creating Cloud Opportunity Talk

Description: Create a cloud phone conversation Syntax:

PhoneClient* createPhoneClient();

Create a batch stream pull controller

Description: Create a batch pull controller

Syntax:

BatchControlVideo* createBatchControlVideo();

Get the camera list

Description: Get a list of cameras

Syntax:

std::vector<DeviceInfo> getVideoDeviceList();

Get the list of microphones

Description: Retrieve the microphone list

Syntax:

std::vector<DeviceInfo> getAudioDeviceList();

Destruction

Description: Destroyed

Syntax:

void destory();

Enable group control

Description: Enable group control

Syntax:

void startEventSync(const BatchPhoneConfig& config)
ParametersTypeIs it required?Description
configBatchPhoneConfigYesGroup control configuration

Stop group control

Description: Stop group control

Syntax:

void stopEventSync()

Set up the main controller

Description: Set up the main control

Syntax:

void setEventSyncMaster(const std::string& podId)
ParametersTypeIs it required?Description
podIdstringYesMain control cloud phone ID

Send text to the specified cloud phone input box

Description: Send text to the specified cloud phone input box

Syntax:

void sendInputText(const std::string& podId, const std::string& content)
ParametersTypeIs it required?Description
podIdstringYesMain control cloud phone ID
contentstringYesThe text content sent must be encoded in UTF-8

Start boosting traffic

Description: Starting to pull flow

Syntax:

void start(const BatchPhoneConfig& config)
ParametersTypeIs it required?Description
configBatchPhoneConfigYesBatch traffic pulling configuration

Stop pulling traffic

Description: Stop pulling the flow

Syntax:

void stop(const std::string& podId)
ParametersTypeIs it required?Description
podIdstringYesCloud server IDs that need to stop pulling streams

Batch stop pulling traffic

Description: Batch stop pulling traffic

Syntax:

void stop(const std::vector<std::string>& podList)
ParametersTypeIs it required?Description
podListstring[]YesList of cloud phone IDs that need to stop pulling traffic

Stop pulling traffic completely

Description: Completely stop pulling flow

Syntax:

void stopAll()

Is it included?

Description: Whether it is included

Syntax:

bool contains(const std::string& podId)
ParametersTypeIs it required?Description
podIdstringYesThe cloud server ID that needs to be queried

Start subscribing

Description: Start subscribing

Syntax:

void subscribe(const std::string& podId)
ParametersTypeIs it required?Description
podIdstringYesCloud ID that needs to subscribe to video streams

Unsubscribe

Description: Unsubscribe

Syntax:

void unsubscribe(const std::string& podId)
ParametersTypeIs it required?Description
podIdstringYesYou need to unsubscribe from the cloud server ID for video streaming

Set up the video renderer

Description: Set up the video renderer

Syntax:

void setVideoSink(const std::string& podId, VideoRenderSink* sink)
ParametersTypeIs it required?Description
podIdstringYesYou need to set the renderer's cloud ID
sinkVideoRenderSinkYesVideo renderer

Set callbacks

Description: Set callback

Syntax:

void setBatchControlObserver(BatchControlObserver* observer)
ParametersTypeIs it required?Description
observerBatchControlObserverYesPullback

Activating Traffic Pulling

Description: Enable streaming pulling

Syntax:

void start(PhoneConfig& config)
ParametersTypeIs it required?Description
configPhoneConfigYesCloud machine connection configuration

Stop pulling traffic

Description: Stop pulling the flow

Syntax:

void stop();

Set up the video renderer

Description: Set up the video renderer

Syntax:

void setVideoSink(VideoRenderSink* sink)
ParametersTypeIs it required?Description
sinkVideoRenderSink*YesVideo renderer

Set up Cloud Phone event callbacks

Description: Call setSessionObserver() to set up cloud phone event callbacks

Syntax:

void setSessionObserver(SessionObserver* observer)
ParametersTypeIs it required?Description
observerSessionObserver*YesEvent retracement

Send a scroll wheel event

Description: Send a scroll wheel event

Syntax:

void sendSwipe(int action, int x, int y, int width, int height, int swipe)
ParametersTypeIs it required?Description
actionintYesEvent retracement
xintYesEvent retracement
yintYesEvent retracement
widthintYesEvent retracement
heightintYesEvent retracement
swipeintYesEvent retracement

Send key events

Description: Send keyboard key event commands to cloud phone instances. This interface sends a full DOWN+UP event. If you need to simulate the Home button, Back key, menu key, or other system function keys, it is recommended.

Syntax:

void sendKeyCode(int code)
ParametersTypeIs it required?Description
codeintYesKey values
3: HOME key
4: BACK key
82: MENU key
187: TASK key

Send key events

Description: Send keyboard key event commands to cloud phone instances. This interface allows you to select the single state (DOWN or UP events). If you need to simulate key events with higher state requirements, such as DELETE, it is recommended.

Syntax:

void sendKeyCode(int action, int code)
ParametersTypeIs it required?Description
actionintYesKey type
0: DOWN status
1: UP status
codeintYesKey values
3: HOME key
4: BACK key
82: MENU key
187: TASK key

Turn up the volume

Description: Increase the volume of cloud phone devices

Syntax:

void volumeUp()

Turn down the volume

Description: Reduce the volume of cloud phone devices

Syntax:

void volumeDown()

Send mouse button events

Description: Sending mouse button events

Syntax:

void sendTouchEvent(int action, int x, int y, int width, int height)
ParametersTypeIs it required?Description
actionintYesKey type
0, DOWN status
1, UP status
2, MOVE status
xintYesClick the coordinates in the x-axis direction
yintYesClick the coordinates in the Y-axis direction
widthintYesLocal screen width of cloud phones
heightintYesThe local screen height of cloud phones

Modify the Pull Flow Quality

Description: Sets the image clarity of cloud phones

Syntax:

void setVideoLevel(int resolution, int fps, int bitrate)
ParametersTypeIs it required?Description
resolutionintYes07:144x256
08:216x384
08:216x384
09:288x512
10:360x640
11:480x848
12:540x960
13:600x1024
14:480x1280
15:720x1280
16:720x1920
17:1080x1920
18:1440x1920
19:1600x2560
20:2880x1080
fpsintYes1:20fps
2:25fps
3:30fps
4:60fps
5:1fps
6:5fps
7:10fps
8:15fps
9:2fps
bitrateintYes01: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 the current cloud phone screen

Syntax:

void screenshot(bool local)
ParametersTypeIs it required?Description
localboolNoScreenshot save location:
true: local
false: cloud phone

Send input text

Description: Send text to replace the cloud phone input box content (it only takes effect when the cloud phone input box is on the focus).

Syntax:

void sendInputText(const std::string& text)
ParametersTypeIs it required?Description
textstringYesThe text content sent must be encoded in UTF-8

Start the audio

Description: Audio on and off

Syntax:

void enableAudio(bool enable)
ParametersTypeIs it required?Description
enableboolYesStatus true, Enable false, Stop

Start the video

Description: Video on/on

Syntax:

void enableVideo(bool enable)
ParametersTypeIs it required?Description
enableboolYesStatus true, Enable false, Stop

Start blowing on it

Description: Blow to turn on the switch

Syntax:

void enableBlow(bool enable)
ParametersTypeIs it required?Description
enableboolYesStatus true, Enable false, Stop

Shake it up

Description: Shake it

Syntax:

void shake()

Enable Camera Capture

Description: Camera data collection enabled

Syntax:

void startVideoCapture(int cameraId)
ParametersTypeIs it required?Description
cameraIdintYesCamera ID

Stop collecting

Description: Stop collecting

Syntax:

void stopVideoCapture()

Publish video streams

Description: Publish video streams

Syntax:

void publishStream()

Stopped publishing

Description: Stopped publishing

Syntax:

void unPublishStream()

Send the adb command

Description: Send the adb command

Syntax:

void sendCommand(const std::string& cmd)
ParametersTypeIs it required?Description
cmdstringYesadb command
Prev
Example Setup
Next
Callback Function