API Overview

Create a cloud phone session

Method nameDescription
initInitialize the ArmcloudEngine engine
destoryDestory the ArmcloudEngine engine
createPhoneClientCreate a cloud phone session
reqBatchStartRequest batch streaming

Cloud phone feature interface

Method nameDescription
startStart the cloud phone
stopStop the cloud phone
setSessionObserverSet session callback
sendKeyCodeSend a keyboard key event (send a complete DOWN + UP event)
sendKeyCodeSend keyboard key events (optionally send single state events)
volumeUpIncrease the volume of the cloud device
volumeDownDecrease the volume of the cloud device
sendTouchEventSend mouse button event
setVideoLevelSet the cloud phone display resolution
screenshotScreenshot
sendInputTextSend text to the input box
enableAudioEnable audio
enableVideoEnable video
enableBlowEnable blowing
shakeShake
setVideoSinkSet the video renderer

Interface detailed description

init

Description:Initialize the ArmcloudEngine engine

Syntax:

void init();

destory

Description:Destroy the ArmcloudEngine engine

Syntax:

void destory();

createPhoneClient

Description:Create a cloud machine session

Syntax:

PhoneClient* createPhoneClient();

reqBatchStart

Description:Request batch streaming

Syntax:

void reqBatchStart(const BatchPhoneConfig& config);
ParameterDescription
configSet up batch request streaming configuration

start

Description:Call start() to launch the cloud phone

Syntax:

void start(const PhoneConfig& config);

stop

Description:Call stop() to stop the cloud phone

Syntax:

void stop();

setSessionObserver

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

Syntax:

void setSessionObserver(SessionObserver* observer)
ParameterDescription
observerCloud phone event callback

sendKeyCode

Description:Send keyboard key event commands to the cloud device instance. This interface sends a complete DOWN+UP event. It is recommended for simulating system function keys such as the Home key, Back key, and Menu key

Syntax:

void sendKeyCode(int code)
ParameterDescription
codeKey value
3:HOME
4:BACK
82:MENU
187:TASK

sendKeyCode

Description:Send keyboard key event commands to the cloud device instance. This interface allows you to choose to send single state events (either DOWN or UP). It is recommended to use this for simulating key events with higher state requirements, such as DELETE

Syntax:

void sendKeyCode(int action, int code)
ParameterDescription
actionStatus
0:DOWN
1:UP
codeKey value
3:HOME
4:BACK
82:MENU
187:TASK

volumeUp

Description:Increase the volume of the cloud device

Syntax:

void volumeUp()

volumeDown

Description:Reduce the volume of the cloud device

Syntax:

void volumeDown()

sendTouchEvent

Description:Send mouse button event

Syntax:

void sendTouchEvent(int action, int x, int y, int width, int height)
ParameterDescription
actionStatus
0、DOWN
1、UP
2、MOVE
xClick coordinates in the X-axis direction
yClick coordinates in the Y-axis direction
widthLocal screen width of the cloud phone
heightLocal screen height of the cloud phone

setVideoLevel

Description:Set the clarity of the cloud phone display

Syntax:

void setVideoLevel(int resolution, int fps, int bitrate)
ParameterDescriptionReference value
resolutionResolution07: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
fpsFrame rate1:20fps
2:25fps
3:30fps
4:60fps
5:1fps
6:5fps
7:10fps
8:15fps
9:2fps
bitrateBitrate01: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:Take a screenshot of the current cloud phone screen.

Syntax:

void screenshot(bool local)
ParameterDescription
localScreenshot save location
true:Local
false:Remote

sendInputText

Description:Send text to replace the content of the cloud device's input box (it will take effect only when the input box is in focus)

Syntax:

void sendInputText(const std::string& text)
ParameterDescription
textThe sent text content must be UTF-8 encoded

enableAudio

Description:Audio toggle switch

Syntax:

void enableAudio(bool enable)
ParameterDescription
enableStatus true:Enable false:Stop

enableVideo

Description:Video toggle switch

Syntax:

void enableVideo(bool enable)
ParameterDescription
enableStatus true:Enable false:Stop

enableBlow

Description:enable Blow

Syntax:

void enableBlow(bool enable)
ParameterDescription
enableStatus true:Enable false:Stop

shake

Description:Shake

Syntax:

void shake()

setVideoSink

Description:Set the video renderer

Syntax:

void setVideoSink(VideoRenderSink* sink)
ParameterDescription
sinkVideo renderer, referenceVideoRenderSink