Методы Remote Control

rc.postJson

public static java.lang.String postJson(java.lang.String url,
                                        java.lang.String json)

Send Post JSON Request

Parameters:

url - URL*

json - JSON in String format


rc.httpGet

public static java.lang.String httpGet(java.lang.String url)

Send HTTP Get Request

Parameters:

url - URL*


rc.hasRoot

public boolean hasRoot()

Check if device has root

Returns:

Boolean


rc.createWakeLock

public void createWakeLock()

Create screen wake lock


rc.releaseWakeLock

public void releaseWakeLock()

Release screen wake lock


rc.click

public void click(int x,
                  int y)
           throws java.lang.InterruptedException

Emulate touch to point with coordinates x,y (need Root)

Parameters:

x - x coordinate*

y - y coordinate

Throws:

java.lang.InterruptedException


rc.pressKey

public void pressKey(int keyCode)

Emulate key press

Parameters:

keyCode - keycode (need Root)


rc.pressPowerButton

public void pressPowerButton()

Emulate power button press (need Root)


rc.pressTab

public void pressTab()
              throws java.lang.InterruptedException

Emulate tab press (need Root)

Throws:

java.lang.InterruptedException


rc.pressEnter

public void pressEnter()
                throws java.lang.InterruptedException

Emulate enter press (need Root)

Throws:

java.lang.InterruptedException


rc.pressBack

public void pressBack()
               throws java.lang.InterruptedException

Emulate back button press (need Root)

Throws:

java.lang.InterruptedException


rc.swipe

public void swipe(int x1,
                  int y1,
                  int x2,
                  int y2,
                  int duration)

Emulate swipe (need Root)


rc.isPackageInstalled

public boolean isPackageInstalled(java.lang.String packageName)

Check if package is installed

Parameters:

packageName - package name

Returns:

Boolean


rc.install

public void install(java.lang.String path)

Install application (need Root)

Parameters:

path - full path to apk


rc.uninstall

public void uninstall(java.lang.String packageName)

Uninstall application (need Root)

Parameters:

packageName - package name


rc.isAppRunning

public boolean isAppRunning(java.lang.String processName)

Check if app is running (need Root)

Returns:

Boolean


rc.startApp

public void startApp(java.lang.String packageName)

Start application (need Root)

Parameters:

packageName - app's package name


rc.stopApp

public void stopApp(java.lang.String packageName)

Stop application (need Root)

Parameters:

packageName - app's package name


rc.wipeApp

public void wipeApp(java.lang.String packageName)

Wipe application (need Root)

Parameters:

packageName - app's package name


rc.downloadFile

public boolean downloadFile(java.lang.String url,
                            java.lang.String dstPath)

Download file

Parameters:

url - URL to file

dstPath - destination path

Returns:

boolean


rc.sendFile

public java.lang.String sendFile(java.lang.String path)

Send File

Parameters:

path - - path to file


rc.clearNotifications

public void clearNotifications()

Clear notifications in status bar (need Root)


rc.isKeyboardVisible

public boolean isKeyboardVisible()

Check if keyboard is visible (need Root)

Returns:

Boolean


rc.isScreenOn

public boolean isScreenOn()

Check if screen is On

Returns:

Boolean


rc.isDefaultLauncher

public boolean isDefaultLauncher(java.lang.String packageName)

Check if package name is default launcher (need Root)

Parameters:

packageName - app's package name

Returns:

Boolean


rc.shell

public java.lang.String shell(java.lang.String command)

Execute shell command (need Root)

Parameters:

command - shell command

Returns:

String


rc.sleep

public void sleep(int ms)

Thread sleep

Parameters:

ms - sleep timeout


rc.command

public java.lang.Boolean command(java.lang.String command)

Execute Remote Bot command

Parameters:

command - bot command


rc.getBotUsername

public java.lang.String getBotUsername()

Get Bot Username


rc.getBotName

public java.lang.String getBotName()

Get Bot Name


rc.getBatteryLevel

public int getBatteryLevel()

Get Battery Level


rc.isCharging

public boolean isCharging()

Is device charging


rc.getDeviceId

public java.lang.String getDeviceId()

Get Device Id