Yisheng API Development Document
Yisheng API Development Document
, LTD
Revised Records
Date Edition Revision note Revised
2019.01.18 .0-201V 390118 Add the get CPU model Chen Huan
2019.05.13 V 3.2-20190513 Add setting system current default language Chen Huan
2020.02.13 V4.1-20200213 Add control over gpio index value Chen Huan
2020.03.30 V4.2-20200330 2. Add the function of upgrading firmware to set whether Chen Huan
firmware file
Catalogue
Revised Records ................................................................................................................................... 2
2.8 Get the device firmware version and compilation date ......................................................... 15
4.3 Get screen wide pixels (this interface has been removed after V5.2) ....................................22
4.4 Get screen high pixels (this interface has been removed after V5.2) .................................... 23
5.5 Whether to delete the firmware package from the file after setting the firmware upgrade ... 41
6.14 ppoe dial-up (this interface has been removed after V5.2) ..................................................51
8.3 Get the current timer switch mode of the device ................................................................... 58
8.4 Get the startup time of the device's current timer switch .......................................................58
8.5 Get the shutdown time of the current timing switch machine ............................................... 59
8.6 Get the last power on time of the device's timer switch ........................................................ 60
8.7 Get the last shutdown time of the device's timer switch ........................................................60
8.10 Get whether the equipment has set the timer switch ........................................................... 62
Shenzhen Yisheng Technology Co., LTD
9.2 Get whether the current gpie is an input port or an output port .............................................63
10.18 Set whether to enable the application installation whitelist and add the app to the list .....77
10.19 Set whether to enable the application installation blacklist and add the app to the list .....78
(2) Right click on jar file in “libs” folder select “add as Library...”, then select “Model”, which can
also be imported successfully
Web :www.yishengtec.cn
8
Shenzhen Yisheng Technology Co., LTD
Call method:
1, Initialize instance
mMyManager.bindAIDLService(this);
Web :www.yishengtec.cn
9
Shenzhen Yisheng Technology Co., LTD
mMyManager.setConnectClickInterface(new MyManager.ServiceConnectedInterface()
{
@Override
});
Web :www.yishengtec.cn
10
Shenzhen Yisheng Technology Co., LTD
Example:
My Manager manager = MyManager.getInstance(this);
Log.d(TAG,"API Version = " + manager.getApiVersion());
/ / Output APIINFO: API Version = V1.0-20180602
Parameter name /
Type Description Example
Return value
Example:
MyManager manager = MyManager.getInstance(this);
Toast.makeText(getApplicationContext(),"Model"+manager.getAndroidModle(),Toast.LENGTH_SHORT).show()
;
/ / Output Model= rk3288
Parameter name /
Type Description Example
Return value
Example:
MyManager manager = MyManager.getInstance(this);
Toast.makeText(getApplicationContext(),"Version="+manager.getAndroidVersion(),Toast.LENGTH_SHORT).sh
ow();
// output Version=19
Web :www.yishengtec.cn
12
Shenzhen Yisheng Technology Co., LTD
Parameter name /
Type Description Example
Return value
Example:
MyManager manager = MyManager.getInstance(this);
Toast.makeText(getApplicationContext(),"RunningMemory"+manager.getRunningMemory(),Toast.LENGTH_SH
ORT).show();
/ / Output of RunningMemory2GB
Web :www.yishengtec.cn
13
Shenzhen Yisheng Technology Co., LTD
Parameter name /
Type Description Example
Return value
Example:
MyManager manager = MyManager.getInstance(this);
Toast.makeText(getApplicationContext(),"InternalStorageMemory:"+manager.getInternalStorageMemory
(),Toast.LENGTH_SHORT).show();
/ / Output InternalStorageMemory: 16GB
Parameter name
Type Description Example
/ Return value
Example:
MyManager manager = MyManager.getInstance(this);
Toast.makeText(getApplicationContext(),"FW:"+manager.getFirmwareVersion(),Toast.LENGTH_SHORT).show()
;
Web :www.yishengtec.cn
14
Shenzhen Yisheng Technology Co., LTD
// output FW:1.0
Parameter name /
Type Description Example
Return value
Example:
MyManager manager = MyManager.getInstance(this);
Log.e("SW kernel Version=” manager.getKernelVersion());
/ / Output SW kernel Version =3.10.86
/**
* @method getAndroidDisplay()
* @description get the firmware version number
* @date 20180602
Web :www.yishengtec.cn
15
Shenzhen Yisheng Technology Co., LTD
* @author sky
* @return firmware version number of the device
*/
Parameter name /
Type Description Example
Return value
Example:
MyManager manager = MyManager.getInstance(this);
Log.e("SWAndroidDisplay=” manager.getAndroidDisplay ());
/ / Output SW AndroidDisplay = aosp _ almond _ dtmb-userdebug 6.0 MRA58K eng.ace.20180523.103817
test-keys
Parameter name /
Type Description Example
Return value
Example:
MyManager manager = MyManager.getInstance(this);
Log. And d ("API display", "getFirmwareDate():" + manager.getFirmwareDate());
/ / Output API display:: getFirmwareDate(): 20180602
Web :www.yishengtec.cn
16
Shenzhen Yisheng Technology Co., LTD
Parameter name /
Type Description Example
Return value
Example:
MyManager manager = MyManager.getInstance(this);
Log. D ("API display", "Device CPU Model:" + manager.getCPUType());
Web :www.yishengtec.cn
17
Shenzhen Yisheng Technology Co., LTD
Parameter name /
Type Description Example
Return value
Example:
MyManager manager = MyManager.getInstance(this);
ToastUtils.showToast (This, "Vendor identifier =" + manager.getVendorID());
Parameter name /
Type Description Example
Return value
Note:
Example:
MyManager manager = MyManager.getInstance(this);
ToastUtils.showToast(this, "sn=" + manager.getSn());
Web :www.yishengtec.cn
18
Shenzhen Yisheng Technology Co., LTD
/ return value
Returned value void
Example:
MyManager manager = MyManager.getInstance(this);
manager.shutdown();
3.2 Restart
Function: public void reboot()
Description: restart
The API version of this interface: V1.0-20180602
/**
* @method reboot()
* @description execute the restart operation and follow the Android standard restart process
* @date 20180602
* @author sky
*/
Web :www.yishengtec.cn
19
Shenzhen Yisheng Technology Co., LTD
/ return value
Returned value void
Example:
MyManager manager = MyManager.getInstance(this);
manager.reboot();
Web :www.yishengtec.cn
20
Shenzhen Yisheng Technology Co., LTD
Chapter 4 Display
4.1 Screenshot save
Function: public boolean takeScreenshot (String path)
Description: capture the current full screen as an image and rename it to the corresponding path
The API version of this interface: V1.0-20180602
/**
* @method takeScreenshot
* @description screenshot, execute this method to save the current screenshot of the system in the specified path
* @date 20180602
* @author sky
* @param path, the path to save the image. Such as, the / mnt/internal_sd/001.jpg
* @return whether the screenshot is successful, True is successful, False is failed
*
*/
/ return value
Parameter name String Save the absolute path “/mnt/internal_sd/001.jpg”
Example:
/ / Screen capture and save to "/ mnt/internal_sd/001.jpg"
MyManager manager = MyManager.getInstance(this);
manager.takeScreenshot(Environment.getExternalStorageDirectory().getPath() +"/001.jpg");
/ Return value
"0"
"90"
Degree String Only support 0, 90, 180, 270 four angles
"180"
"270"
Example:
MyManager manager = MyManager.getInstance(this);
manager.rotateScreen(context,"90");
4.3 Get screen wide pixels (this interface has been removed after V5.2)
Function: public int getDisplayWidth (Context context)
Description: get the display resolution wide X pixels.
The API version of this interface: V1.0-20180602
/**
* @method getDisplayWidth(Context context)
* @description get the screen width
* @date 20180602
* @author sky
* @param context, context object
* @return screen width
*/
Web :www.yishengtec.cn
22
Shenzhen Yisheng Technology Co., LTD
Parameter name /
Type Description Example
Return value
Example:
MyManager manager = MyManager.getInstance(this);
manager.getDisplayWidth(context);
4.4 Get screen high pixels (this interface has been removed after V5.2)
Function: public int getScreenHeight()
Description: get display resolution high Y pixels
The API version of this interface: V1.0-20180602
/**
* @method getDisplayHeight(Context context)
* @description get the screen height
* @date 20180602
* @author sky
* @param context, context object
* @return screen height
*/
Parameter name /
Type Description Example
Return value
Example:
/ / Get the resolution at a 1080p screen
MyManager manager = MyManager.getInstance(this);
Web :www.yishengtec.cn
23
Shenzhen Yisheng Technology Co., LTD
int x = manager.getDisplayWidth(context);
int y = manager.getDisplayHeight(context);
Log. And d ("API display:", "Width =" + x + "Height =" + y);
/ / Will output the Width: Height= 1920:1080
/**
* @method hideNavBar(boolean hide)
* @description set the display or hide the navigation
* @date 20180602
* @author sky
* @param hide pass True to hide the navigation bar and False to display.
*/
Parameter name /
Type Description Example
Return value
Example:
MyManager manager = MyManager.getInstance(this);
manager.hideNavBar (true); / / How to hide the navigation bar
Web :www.yishengtec.cn
24
Shenzhen Yisheng Technology Co., LTD
/**
* @method getNavBarHideState()
* @description get the state of the navigation bar
* @date 20180602
* @author sky
* @return navigation bar hide returns True, and display returns False
*/
Parameter name /
Type Description Example
Return value
True-hidden
Returned value Boolean
False-display
Example:
MyManager manager = MyManager.getInstance(this);
if(manager.getNavBarHideState()){
Log.e("StatusBar hide.”);
}else{
Log.e("StatusBar show.”);
}
Web :www.yishengtec.cn
25
Shenzhen Yisheng Technology Co., LTD
Return value
Example:
MyManager manager = MyManager.getInstance(this);
manager.setSlideShowNavBar (true); / / Turn on the slide-out navigation bar
Parameter name /
Type Description Example
Return value
True-on
Returned value Boolean
False-off
Example:
MyManager manager = MyManager.getInstance(this);
if(manager.isSlideShowNavBarOpen){
Log.e("SlideShowNavBar open.”);
}else{
Log.e("SlideShowNavBar close”);
Web :www.yishengtec.cn
26
Shenzhen Yisheng Technology Co., LTD
Example:
MyManager manager = MyManager.getInstance(this);
manager.setSlideShowNavBar (true); / / Turn on the drop-down notification bar
* @author sky
* @return turn on the drop-down notification bar returns True, otherwise return False
*/
Parameter name /
Type Description Example
Return value
True-on
Returned value Boolean
False-off
Example:
MyManager manager = MyManager.getInstance(this);
if(manager.isSlideShowNavBarOpen){
Log.e("SlideShowNavBar open.”);
}else{
Log.e("SlideShowNavBar close”);
}
/**
* @method hideStatusBar(boolean hide)
* @description set the display or hide the status bar
* @date 2021/1/12
* @author sky
* @param hide Hidden the status bar to pass False and display it to pass True
*/
Parameter name /
Type Description Example
Return value
Web :www.yishengtec.cn
28
Shenzhen Yisheng Technology Co., LTD
Example:
MyManager manager = MyManager.getInstance(this);
manager.hideStatusBar (false); / / hidden status bar
Parameter name /
Type Description Example
Return value
True-hidden
Returned value Boolean
False-display
Example:
MyManager manager = MyManager.getInstance(this);
if(manager.getStatusBar()){
Log.e("StatusBar hide.”);
}else{
Log.e("StatusBar show.”);
}
Web :www.yishengtec.cn
29
Shenzhen Yisheng Technology Co., LTD
Example:
MyManager manager = MyManager.getInstance(this);
manager.turnOffBacklight();
Example:
manager.turnOnBacklight();
Web :www.yishengtec.cn
30
Shenzhen Yisheng Technology Co., LTD
True-backlight on
Returned value Boolean
False-backlight off
Example:
MyManager manager = MyManager.getInstance(this);
manager.isBacklightOn();
Web :www.yishengtec.cn
31
Shenzhen Yisheng Technology Co., LTD
Note: The parameter values are set from 1 to 100, setting 100 represents the maximum brightness and 1
represents the minimum brightness
Example: manager.changeScreenLight(50);
Example:
MyManager manager = MyManager.getInstance(this);
manager.getSystemBrightness();
Web :www.yishengtec.cn
32
Shenzhen Yisheng Technology Co., LTD
/**
* @method turnOffHDMI()
* @description turn off the HDMI output, only turn off the signal output, and other system functions are not
affected
* @date 20180602
* @author sky
*/
Example:
MyManager manager = MyManager.getInstance(this);
manager.turnOffHDMI();
Example:
MyManager manager = MyManager.getInstance(this);
manager.turnOnHDMI();
/**
* @method viceScreenshot
Web :www.yishengtec.cn
33
Shenzhen Yisheng Technology Co., LTD
* @description screenshot, execute this method to save the current screenshot of the system in the specified path
* @date 20180602
* @author sky
* @param path, the path to save the image. Such as, the / mnt/internal_sd/001.jpg
* @return whether the screenshot is successful, True successful, False failed
*
*/
Parameter name
Type Description Example
/ Return value
Parameter name String Save the absolute path “/mnt/internal_sd/001.jpg”
Example:
/ / Screen capture and save to "/ mnt/internal_sd/001.jpg"
MyManager manager = MyManager.getInstance(this);
manager.viceScreenshot(Environment.getExternalStorageDirectory().getPath() +"/001.jpg");
Web :www.yishengtec.cn
34
Shenzhen Yisheng Technology Co., LTD
Return value
Example:
MyManager manager = MyManager.getInstance(this);
ToastUtils.showToast (This, "Main screen type is:" + manager.getHomeScreenType());
Parameter name /
Type Description Example
Return value
Example:
MyManager manager = MyManager.getInstance(this);
ToastUtils.showToast (This, "secondary screen type is:" + manager.getSecondaryScreenType());
Web :www.yishengtec.cn
35
Shenzhen Yisheng Technology Co., LTD
/**
* @param * @param
* @return return the dpi
* @method getDpi
* @description get the DPI
* @date: 2021/1/12
* @author: zouyuanhang
*/
Parameter name /
Type Description Example
Return value
Example:
MyManager manager = MyManager.getInstance(this);
manager.getDpi();
Web :www.yishengtec.cn
36
Shenzhen Yisheng Technology Co., LTD
Example:
MyManager manager = MyManager.getInstance(this);
manager.setDpi(0);
Web :www.yishengtec.cn
37
Shenzhen Yisheng Technology Co., LTD
Note:
1. The function will automatically restart the system for the “update.zip” upgrade.
2. Ensure that the “zip” files exist and are fully available.
3. The filename must be a “update.img or “updat.zip”。
Example:
MyManager manager = MyManager.getInstance(this);
manager.upgradeSystem(“/mnt/internal_sd/update.zip ”);
5.2 Recovery
Function: public boolean rebootRecovery()
Description: will restart into recovery mode
Web :www.yishengtec.cn
38
Shenzhen Yisheng Technology Co., LTD
/**
* @method rebootRecovery()
* @description restore factory settings
* @date 20180602
* @author sky
*/
Example:
MyManager manager = MyManager.getInstance(this);
manager.rebootRecovery();
Parameter name /
Type Description Example
Return value
Web :www.yishengtec.cn
39
Shenzhen Yisheng Technology Co., LTD
Note:
The APK files exist and are fully available.
Example:
/ / Install the test.apk
MyManager manager = MyManager.getInstance(this);
boolean success = manager.silentInstallApk("/mnt/usb/0000-0000/YiShengTest.apk",false);
/ / Silent installation YiShentTest. Apk, do not turn on the apk after the successful installation
Web :www.yishengtec.cn
40
Shenzhen Yisheng Technology Co., LTD
Example:
MyManager manager = MyManager.getInstance(this);
manager.setUpdateSystemWithDialog (true); / / Set upgrade firmware pop up confirmation
5.5 Whether to delete the firmware package from the file after setting the
firmware upgrade
Function: public boolean setUpdateSystemDelete (boolean flag)
Description: whether to delete the firmware package from the file after setting the firmware upgrade
The API version of this interface: V4.2-20200330
/**
* @method setUpdateSystemDelete(boolean flag)
* @description whether to delete the firmware package from the file after setting the firmware upgrade, the
default is not deleted
* @date 20200330
* @author sky
* @param flag to delete after successful upgrade returns True, and not to delete after successful upgrade
returns False
*/
Parameter name /
Type Description Example
Return value
Example:
MyManager manager = MyManager.getInstance(this);
manager.setUpdateSystemDelete (true); / / Set upgrade successfully delete firmware
Web :www.yishengtec.cn
41
Shenzhen Yisheng Technology Co., LTD
Example:
MyManager manager = MyManager.getInstance(this);
manager.unInstallApk("com.bjw.ComAssistant");
Web :www.yishengtec.cn
42
Shenzhen Yisheng Technology Co., LTD
Chapter 6 Network
6.1 Get the device network mode
Function: public int getCurrentNetType()
Description: get the current Internet type
The API version of this interface: V1.0-20180602
/**
* @method getCurrentNetType()
* @description get the current network type
* @date 20180602
* @author sky
* @return returns “int” value, 0 Ethernet, 1 WIFI, 2 mobile network, -100 unknown network
*/
Parameter name /
Type Description Example
Return value
Example:
MyManager manager = MyManager.getInstance(this);
Int type = manager.getCurrentNetType();
*/
Parameter name /
Type Description Example
Return value
Example:
MyManager manager = MyManager.getInstance(this);
Log.e("ETH MAC=” manager.getEthMacAddress ());
/ / Output ETH MAC =30:1F: 9A: 61: BA: 8F
Parameter name /
Type Description Example
Return value
Example:
MyManager manager = MyManager.getInstance(this);
Log. D ("API display", "Current mode =" + manager.getEthMode());
/ / Output, current mode = DHCP
Web :www.yishengtec.cn
44
Shenzhen Yisheng Technology Co., LTD
True (on)
Returned value Boolean Ethernet switch status
False (off)
Example:
MyManager manager = MyManager.getInstance(this);
Log. D ("API display", "whether Ethernet is turned on =" + manager.getEthStatus());
/ / Output whether Ethernet is turned on = false
Web :www.yishengtec.cn
45
Shenzhen Yisheng Technology Co., LTD
Parameter name
Type Description Example
/Return value
Example:
MyManager manager = MyManager.getInstance(this);
Log. D ("API display", "Subnet mask for Ethernet =" + manager.getNetMask());
/ / Output Subnet mask for the Ethernet = 255.255.255.0
Example:
MyManager manager = MyManager.getInstance(this);
Log. D ("API display", "Ethernet gateway =" + manager.getGateway());
/ /Output Ethernet gateway = 192.168.1.1
Web :www.yishengtec.cn
46
Shenzhen Yisheng Technology Co., LTD
Example:
MyManager manager = MyManager.getInstance(this);
Log. And d ("API display", "dns 1 of Ethernet =" + manager.getEthDns1 ());
/ / Output the dns of Ethernet with 1 = 192.168.1.1
Example:
Web :www.yishengtec.cn
47
Shenzhen Yisheng Technology Co., LTD
Example:
MyManager manager = MyManager.getInstance(this);
manager.setDhcpIpAddress(this);
Web :www.yishengtec.cn
48
Shenzhen Yisheng Technology Co., LTD
/**
* @method setStaticEthIPAddress(String IPaddr, String gateWay, String mask, String dns1, String dns2)
* @description set the Ethernet mode to static, and specify the relevant parameters
* @date 20180602
* @author sky
* @param IPaddr, set IP address.gateWay, Set the gateway. Mask, set the subnet mask. The dns 1 and dns 2
are the set dns values
*/
Parameter name /
Type Description Example
Return value
Note: Gateway, subnet mask, and DNS should be set to legal data
Example:
MyManager manager = MyManager.getInstance(this);
manager.setStaticEthIPAddress("192.168.1.125", "192.168.1.1","255.255.255.0","192.168.1.1","0.0.0.0");
Web :www.yishengtec.cn
49
Shenzhen Yisheng Technology Co., LTD
* @date 20180602
* @author sky
* @return returns the Ethernet dynamic IP address
*/
Parameter name /
Type Description Example
Return value
Example:
MyManager manager = MyManager.getInstance(this);
Log. And d ("API Display", "ETH IP =" + myManager.getDhcpIpAddress());
/ / Output: ETH IP =192.168.1.103
Example:
MyManager manager = MyManager.getInstance(this);
Log. And d ("API Display", "ETH IP =" + manager.getStaticEthIPAddress();
/ / Output: ETH IP =192.168.1.103
Web :www.yishengtec.cn
50
Shenzhen Yisheng Technology Co., LTD
/**
* @method ethEnabled(boolean enable)
* @description control the Ethernet switch
* @date 20180602
* @author sky
* @param enable, turn on the Ethernet switch incoming true, close the Ethernet switch incoming false
*/
Parameter name /
Type Description Example
Return value
True-turn on Ethernet
Parameter Boolean True-on; false-off
False-turn off Ethernet
Example:
MyManager manager = MyManager.getInstance(this);
manager.ethEnabled (false); / / close Ethernet
6.14 ppoe dial-up (this interface has been removed after V5.2)
Function: public void setPppoeDial (Context context, String userName, String password)
Description: set ppppoe dial-up
The API version of this interface: V4.2-20200330
Parameter name /
Type Description Example
Return value
Web :www.yishengtec.cn
51
Shenzhen Yisheng Technology Co., LTD
Example:
MyManager manager = MyManager.getInstance(this);
manager.setPppoeDial(this,”username ”,”password ”);
Web :www.yishengtec.cn
52
Shenzhen Yisheng Technology Co., LTD
Chapter 7 Storage
7.1 Query the external storage SD card path
Function: public String getSDcardPath()
Description: get the external storage SD card path
The API version of this interface: V1.0-20180602
/**
* @method getSDcardPath()
* @description get the external SD card path
* @date 20180602
* @author sky
* @return returns to the external SD card path
*/
Parameter name /
Type Description Example
Return value
Example:
MyManager manager = MyManager.getInstance(this);
Log. And d (API Test, SD=, + manager.getSDcardPath());
/ / Output API: external SD card path = / mnt / external _ sd
*/
Parameter name /
Type Description Example
Return value
Note:
Need to set the path in the source code to run the Demo normally
Example:
MyManager manager = MyManager.getInstance(this);
Log. And d (API Test, USB Path =, + manager.getUSBStoragePath(0));
/ / Output / mnt / usb _ storage / USB _ DISK 2 / udisk0;
/**
* @method getUartPath(String uart)
* @description get the absolute path of the serial port
* @date 20180602
* @author sky
* @param uart, the serial port is the incoming serial number, like the serial port 0 into TTYS 0
* @return returns the absolute path of the specified serial port
*/
Parameter name /
Type Description Example
Return value
Web :www.yishengtec.cn
54
Shenzhen Yisheng Technology Co., LTD
Example:
MyManager manager = MyManager.getInstance(this);
Log. And d ("API test", "UART-1=" + manager.getUartPath (“TTYS1”));
/ / Output UART-1= / dev / ttyS 1
Web :www.yishengtec.cn
55
Shenzhen Yisheng Technology Co., LTD
Note:
This method can only have one set of time in a day, and the startup time is before, and the shutdown time is
after
Example:
MyManager manager = MyManager.getInstance(this);
int [] timeonArray = new int{8,30};
Web :www.yishengtec.cn
56
Shenzhen Yisheng Technology Co., LTD
Note:
When this method is set, the shutdown time is before, and the startup time is after
Example:
Web :www.yishengtec.cn
57
Shenzhen Yisheng Technology Co., LTD
Example:
MyManager manager = MyManager.getInstance(this);
m anager.getPowerOnMode();
8.4 Get the startup time of the device's current timer switch
Function: public String getPowerOnTime()
Description: get the startup time
The API version of this interface: V4.0-20200115
/**
Web :www.yishengtec.cn
58
Shenzhen Yisheng Technology Co., LTD
* @method getPowerOnTime()
* @description get the startup time of the current device
* @date 20200113
* @author sky
* @return returns to the current set boot time, such as 202001132025, refers to the 20:25 boot on January
13,2020
*/
Parameter name /
Type Description Example
Return value
Example:
MyManager manager = MyManager.getInstance(this);
m anager.getPowerOnTime();
8.5 Get the shutdown time of the current timing switch machine
Function: public String getPowerOffTime()
Description: get the shutdown time of the timer switch
The API version of this interface: V4.0-20200115
/**
* @method getPowerOffTime()
* @description get the shutdown time of the current device
* @date 20200113
* @author sky
* @return returns to the current boot time set, such as 202001132020, refers to the 20:20 shutdown on
January 13,2020
*/
Parameter name /
Type Description Example
Return value
Example:
MyManager manager = MyManager.getInstance(this);
Web :www.yishengtec.cn
59
Shenzhen Yisheng Technology Co., LTD
m anager.getPowerOffTime();
8.6 Get the last power on time of the device's timer switch
Function: public String getLastestPowerOnTime()
Description: get the last executed boot time of the device
Parameter name /
Type Description Example
Return value
Example:
MyManager manager = MyManager.getInstance(this);
m anager.getLastestPowerOnTime();
8.7 Get the last shutdown time of the device's timer switch
Function: public String getLastestPowerOffTime()
Description: get the startup time last performed
The API version of this interface: V4.0-20200115
/**
Web :www.yishengtec.cn
60
Shenzhen Yisheng Technology Co., LTD
* @method getLastestPowerOffTime()
* @description get the startup time of the device last performed
* @date 20200113
* @author sky
* @return the last startup time of the return device, such as 202001132020, means that the startup operation
was performed at 20:20 on January 13,2020
*/
Parameter name /
Type Description Example
Return value
Example:
MyManager manager = MyManager.getInstance(this);
m anager.getLastestPowerOffTime();
Example:
MyManager manager = MyManager.getInstance(this);
m anager.clearPowerOnOffTime();
Web :www.yishengtec.cn
61
Shenzhen Yisheng Technology Co., LTD
Parameter name /
Type Description Example
Return value
Example:
MyManager manager = MyManager.getInstance(this);
m anager.getVersion();
8.10 Get whether the equipment has set the timer switch
Function: public boolean isSetPowerOnTime()
Description: get whether the device is equipped with a timer switch
Parameter name /
Type Description Example
Return value
Example:
MyManager manager = MyManager.getInstance(this);
m anager.isSetPowerOnTime();
Web :www.yishengtec.cn
62
Shenzhen Yisheng Technology Co., LTD
Example:
MyManager manager = MyManager.getInstance(this);
m anager.setGpioDirection(1, 0);
9.2 Get whether the current gpie is an input port or an output port
Function: public String getGpioDirection (int gpio)
Web :www.yishengtec.cn
63
Shenzhen Yisheng Technology Co., LTD
Description: Get whether the current state of the gpio is input or output based on the specific gpio value. This
method also determines if the gpio is valid, if no value is returned, it means that the gpio is not available
The API version of this interface: V4.1-20200213
/**
* @method getGpioDirection(int gpio)
* @description get whether the current state of the gpio is input or output based on the specific gpio value
* @date 20200213
* @author sky
* @param gpio, gpio value
* @return the input port returns In, and the output port returns Out
*/
Parameter name /
Type Description Example
Return value
Example:
MyManager manager = MyManager.getInstance(this);
m anager.getGpioDirection(1);
Web :www.yishengtec.cn
64
Shenzhen Yisheng Technology Co., LTD
Parameter name /
Type Description Example
Return value
Example:
MyManager manager = MyManager.getInstance(this);
m anager.writeGpioValue(1, 1);
Returned value String High level or low level High level- -1 and low level- -0
Example:
MyManager manager = MyManager.getInstance(this);
m anager.getGpioValue(1);
Web :www.yishengtec.cn
65
Shenzhen Yisheng Technology Co., LTD
Chapter 10 Other
10.1 Set and save the system time
Function: public boolean setTime (int year, int month, int day, int hour, int minute, int sec)
Description: set and save the system time
The API version of this interface: V1.0-20180602
/**
* @method setTime(int year, int month, int day, int hour, int minute, int sec)
* @description set the system time
* @date 20180602
* @author sky
* @param enter the year, month, day, hour, minute and second to be set, where the month is from 1-12, and
the time is in 24-hour system.
*/
Parameter name /
Type Description Example
Return value
Example:
/ / Settings 2016-03-16,13:44:20
MyManager manager = MyManager.getInstance(this);
manager.setTime (2016, 3, 16, 13, 44,20);
Web :www.yishengtec.cn
66
Shenzhen Yisheng Technology Co., LTD
Example:
MyManager manager = MyManager.getInstance(this);
manager.switchAutoTime (false); / / Close the automatic date and time
* @param hidden, enter True is to hide the soft keyboard,enter False is to display the soft keyboard
*/
Parameter name /
Type Description Example
Return value
Example:
MyManager manager = MyManager.getInstance(this);
manager.setSoftKeyboardHidden(false);
value
Web :www.yishengtec.cn
68
Shenzhen Yisheng Technology Co., LTD
Example:
MyManager manager = MyManager.getInstance(this);
manager.setDormantInterval(context,15000);
Example:
MyManager manager = MyManager.getInstance(this);
manager.isAutoSyncTime();
Web :www.yishengtec.cn
69
Shenzhen Yisheng Technology Co., LTD
* @param command, pass in shell commands that required to be executed, such as reboot
*/
Parameter name /
Type Description Example
Return value
Example:
/ / Execution restart
MyManager manager = MyManager.getInstance(this);
manager.execSuCmd (“reboot ”);
Returned value Boolean False-no HDMI output, True- has HDMI output
Example:
MyManager manager = MyManager.getInstance(this);
Toast.makeText(getApplicationContext(),”HDMI” +
manager.getHdmiinStatus(),Toast.LENGTH_SHORT).show();
Web :www.yishengtec.cn
70
Shenzhen Yisheng Technology Co., LTD
Example:
MyManager manager = MyManager.getInstance(this);
manager.isSetDefaultInputMethodSuccess(“com.google.android.inputmethod.pinyin/.PinyinIME ”);
* @return returns the package name of the current input method, such as
com.google.android.inputmethod.pinyin/.PinyinIME
*/
Parameter name /
Type Description Example
Return value
Example:
MyManager manager = MyManager.getInstance(this);
manager.getDefaultInputMethod();
Example:
MyManager manager = MyManager.getInstance(this);
manager.setLanguage(“zh ”,”CN ”);
Web :www.yishengtec.cn
72
Shenzhen Yisheng Technology Co., LTD
Example:
MyManager manager = MyManager.getInstance(this);
Log. D ("API display", "Device CPU temperature:" + manager.getCPUTemperature());
Web :www.yishengtec.cn
73
Shenzhen Yisheng Technology Co., LTD
Parameter name /
Type Description Example
Return value
False: close
Example:
MyManager manager = MyManager.getInstance(this);
manager.setADBOpen(true);
Parameter name /
Type Description Example
Return value
value
Example:
Web :www.yishengtec.cn
74
Shenzhen Yisheng Technology Co., LTD
Parameter name /
Type Description Example
Return value
Example:
MyManager manager = MyManager.getInstance(this);
manager.setDefaultLauncher("com.android.launcher3/com.android.launcher3.Launcher");
Web :www.yishengtec.cn
75
Shenzhen Yisheng Technology Co., LTD
* @description execute the shutdown operation, following the standard Android shutdown process
* @date 20180602
* @author sky
*/
Example:
MyManager manager = MyManager.getInstance(this);
manager.shutdown();
Example:
MyManager manager = MyManager.getInstance(this);
manager.selfStart("rkandroidapi.ys.com.rkandroidapi");
Web :www.yishengtec.cn
76
Shenzhen Yisheng Technology Co., LTD
Example:
MyManager manager = MyManager.getInstance(this);
manager.daemon("rkandroidapi.ys.com.rkandroidapi",1);
Web :www.yishengtec.cn
77
Shenzhen Yisheng Technology Co., LTD
* @method setAppInstallWhitelist
* @description Add a whitelist of app installations
* @date: 2021/1/12
* @author: zouyuanhang
*/
Parameter
value
True
True-enabled whitelist Note: If you close the whitelist, need to input
Parameter String
False-disable whitelist the value false to attribute persist.neo.
WhiteList
Example:
MyManager manager = MyManager.getInstance(this);
manager.setAppInstallWhitelist("true","rkandroidapi.ys.com.rkandroidapi");
Web :www.yishengtec.cn
78
Shenzhen Yisheng Technology Co., LTD
* @date: 2021/1/12
* @author: zouyuanhang
*/
Parameter name /
Type Description Example
return value
True
True-enabled blacklist
Parameter String Note: If you close the blacklist, need to input the
False-disable blacklist
value false to persist.neo.blackList
Add the application package
Parameter String rkandroidapi.ys.com.rkandroidapi
name for the blacklist
value
Example:
MyManager manager = MyManager.getInstance(this);
manager.setAppInstallBlacklist("true","rkandroidapi.ys.com.rkandroidapi");
Web :www.yishengtec.cn
79
Shenzhen Yisheng Technology Co., LTD
Example:
MyManager manager = MyManager.getInstance(this);
manager.setNetworkAdb(true);
Web :www.yishengtec.cn
80