SDK Development Documentation

Background

This column aims to help developers using iMin POS machines quickly adapt to iMin devices. Starting from Android 13, we have made a comprehensive upgrade. Compared to previous SDKs, it can be adapted once and then ported to other iMin devices or version upgrades without re-adaptation. For the adaptation workload brought by Android major version upgrades, we have provided adaptation guidelines. Please refer to Android Version Application Adaptation Guide

1. Quick SDK Integration

Method 1: (Recommended)

Add in settings.gradle

dependencyResolutionManagement {
    repositoriesMode.set(RepositoriesMode.FAIL_ON_PROJECT_REPOS)
    repositories {
        mavenCentral()
        maven { url 'https://jitpack.io' }
    }
}

Add in app/build.gradle

implementation 'com.github.iminsoftware:IminDeviceLibrary:3.0.0'

After completion, rebuild the project.

Demo can refer to this link: https://github.com/iminsoftware/IminDeviceLibrary

Method 2

Download IminLib3.0.jar, place the jar file in the libs directory

Add in app/build.gradle

implementation 'files("libs/IminLibs.jar")'

After importing the jar package, rebuild the project.

For development documentation, refer to IminLibs3.0 Integration Guide, you can download demo source code for functional testing

2. SDK Initialization

2.1 Initialization

//Initialize in project Application
DeviceManager.initialize(this);

2.2 Get Component Manager

//Get component manager
DeviceManager mDeviceManager = DeviceManager.getDeviceManager(this);

2.3 Check if Initialization is Successful

if(mDeviceManager.isInitialized()){
    //Can only call related functions after successful initialization
}

3. API List

3.1 Device Information Related APIs

3.1.1 Get Device Model

Property

Description

Method

void getDeviceInfoAsyn(String name, IAsyncCallback callback)

Parameter

name: DEVICE_INFO_GET_MODEL

Return Parameter

String result: Device model

Example

mDeviceManager.getDeviceInfoAsyn("DEVICE_INFO_GET_MODEL", new IAsyncCallback.Stub() {
    @Override
    public void onResult(String result) throws RemoteException {
        Log.d(TAG, result);
    }
});

3.1.2 Get Device Hardware Platform

Property

Description

Method

void getDeviceInfoAsyn(String name, IAsyncCallback callback)

Parameter

name:DEVICE_INFO_GET_PLATFORM

Return Parameter

String result: Hardware platform

Example

mDeviceManager.getDeviceInfoAsyn("DEVICE_INFO_GET_PLATFORM", new IAsyncCallback.Stub() {
    @Override
    public void onResult(String result) throws RemoteException {
        Log.d(TAG, result);
    }
});

3.1.3 Get Device Brand

Property

Description

Method

void getDeviceInfoAsyn(String name, IAsyncCallback callback)

Parameter

name:DEVICE_INFO_GET_BRAND

Return Parameter

String result: Device brand

Example

mDeviceManager.getDeviceInfoAsyn("DEVICE_INFO_GET_BRAND", new IAsyncCallback.Stub() {
    @Override
    public void onResult(String result) throws RemoteException {
        Log.d(TAG, result);
    }
});

3.1.4 Get Device SN

Property

Description

Method

void getDeviceInfoAsyn(String name, IAsyncCallback callback)

Parameter

name:DEVICE_INFO_GET_SN

Return Parameter

String result: Device SN

Example

mDeviceManager.getDeviceInfoAsyn("DEVICE_INFO_GET_SN", new IAsyncCallback.Stub() {
    @Override
    public void onResult(String result) throws RemoteException {
        Log.d(TAG, result);
    }
});

3.1.5 Check if Device is Dual Screen

Property

Description

Method

void getDeviceInfoAsyn(String name, IAsyncCallback callback)

Parameter

name:DEVICE_INFO_GET_DUALSCREEN

Return Parameter

result:
true: Dual screen device
false: Not dual screen

Example

mDeviceManager.getDeviceInfoAsyn("DEVICE_INFO_GET_DUALSCREEN", new IAsyncCallback.Stub() {
    @Override
    public void onResult(String result) throws RemoteException {
        Log.d(TAG, result);
    }
});

3.1.6 Get Hardware Device Information

Property

Description

Method

void getDeviceInfoAsyn(String name, IAsyncCallback callback)

Parameter

name:DEVICE_INFO_HW_INFO
callback:Return data refer to HardwareInfo class

Return Parameter

String result: Return data refer to HardwareInfo class

Example

mDeviceManager.getDeviceInfoAsyn("DEVICE_INFO_HW_INFO", new IAsyncCallback.Stub() {
    @Override
    public void onResult(String result) throws RemoteException {
        Log.d(TAG, result);
    }
});

3.1.7 Get Network Information

Property

Description

Method

void getDeviceInfoAsyn(String name, IAsyncCallback callback)

Parameter

name:DEVICE_INFO_NETWORK_INFO
callback:Return data refer to NetworkInfo class

Return Parameter

String result: Return data refer to NetworkInfo class

Example

mDeviceManager.getDeviceInfoAsyn("DEVICE_INFO_NETWORK_INFO", new IAsyncCallback.Stub() {
    @Override
    public void onResult(String result) throws RemoteException {
        Log.d(TAG, result);
    }
});

3.1.8 Get Device Software Information

Property

Description

Method

void getDeviceInfoAsyn(String name, IAsyncCallback callback)

Parameter

name:DEVICE_INFO_SW_INFO
callback:Return data refer to SoftwareInfo class

Return Parameter

String result: Return data refer to SoftwareInfo class

Example

mDeviceManager.getDeviceInfoAsyn("DEVICE_INFO_SW_INFO", new IAsyncCallback.Stub() {
    @Override
    public void onResult(String result) throws RemoteException {
        Log.d(TAG, result);
    }
});

3.1.9 Get Device Display Information

Property

Description

Method

void getDeviceInfoAsyn(String name, IAsyncCallback callback)

Parameter

name:DEVICE_INFO_DISPLAY_INFO
callback:Return data refer to DisplayInfo class

Return Parameter

String result: Return data refer to DisplayInfo class

Example

mDeviceManager.getDeviceInfoAsyn("DEVICE_INFO_DISPLAY_INFO", new IAsyncCallback.Stub() {
    @Override
    public void onResult(String result) throws RemoteException {
        Log.d(TAG, result);
    }
});

3.1.10 Get Device Memory and Storage Information

Property

Description

Method

void getDeviceInfoAsyn(String name, IAsyncCallback callback)

Parameter

name:DEVICE_INFO_MEMORY_INFO
callback:Return data refer to MemoryInfo class

Return Parameter

String result: Return data refer to MemoryInfo class

Example

mDeviceManager.getDeviceInfoAsyn("DEVICE_INFO_MEMORY_INFO", new IAsyncCallback.Stub() {
    @Override
    public void onResult(String result) throws RemoteException {
        Log.d(TAG, result);
    }
});

3.1.11 Get Device Memory Details

Property

Description

Method

void getDeviceInfoAsyn(String name, IAsyncCallback callback)

Parameter

name:DEVICE_INFO_MEMORY_DETIAL_INFO
callback:Return data refer to MemoryDetail class

Return Parameter

String result: Return data refer to MemoryDetail class

Example

mDeviceManager.getDeviceInfoAsyn("DEVICE_INFO_MEMORY_DETIAL_INFO", new IAsyncCallback.Stub() {
    @Override
    public void onResult(String result) throws RemoteException {
        Log.d(TAG, result);
    }
});

3.1.12 Get Device Storage Details

Property

Description

Method

void getDeviceInfoAsyn(String name, IAsyncCallback callback)

Parameter

name:DEVICE_INFO_STORAGE_INFO
callback:Return data refer to StorageDetail class

Return Parameter

String result: Return data refer to StorageDetail class

Example

mDeviceManager.getDeviceInfoAsyn("DEVICE_INFO_STORAGE_INFO", new IAsyncCallback.Stub() {
    @Override
    public void onResult(String result) throws RemoteException {
        Log.d(TAG, result);
    }
});

3.1.13 Get CPU Information

Property

Description

Method

void getDeviceInfoAsyn(String name, IAsyncCallback callback)

Parameter

name:DEVICE_INFO_CPU_INFO
callback:Return data refer to CPUDetail class

Return Parameter

String result: Return data refer to CPUDetail class

Example

mDeviceManager.getDeviceInfoAsyn("DEVICE_INFO_CPU_INFO", new IAsyncCallback.Stub() {
    @Override
    public void onResult(String result) throws RemoteException {
        Log.d(TAG, result);
    }
});

3.2 Device Operation Related APIs

3.2.1 Set Bluetooth Name

Property

Description

Method

sendAMCommandAsyn(String json, IAsyncCallback callback)

Function

Set Bluetooth Name

API Restriction

Android 15

Parameter

json:{"oemConfig":{"setBTName":"bt11"}}
callback:Callback
Note:setBTName:String Bluetooth name

Example

JsonObject controlBean = new JsonObject();
JsonObject oemConfig = new JsonObject();
controlBean.add("oemConfig", oemConfig);
oemConfig.addProperty("setBTName", "bt11");
try {
    mDeviceManager.sendAMCommandAsyn(new Gson().toJson(controlBean), 
        new IAsyncCallback.Stub() {
        @Override
        public void onResult(String result) throws RemoteException {
            Log.d(TAG, result);
        }
    });
} catch (RemoteException e) {
    e.printStackTrace();
}

3.2.2 Set Virtual Bluetooth Name

Property

Description

Method

sendAMCommandAsyn(String json, IAsyncCallback callback)

Function

Set Virtual Bluetooth Name

API Restriction

Android 15

Parameter

json:{"oemConfig":{"setDeviceVirtualBluetoothName":"vbt11"}}
callback:Callback
Note:setDeviceVirtualBluetoothName:String Virtual Bluetooth name

Example

JsonObject controlBean = new JsonObject();
JsonObject oemConfig = new JsonObject();
controlBean.add("oemConfig", oemConfig);
oemConfig.addProperty("setDeviceVirtualBluetoothName", "vbt11");
try {
    mDeviceManager.sendAMCommandAsyn(new Gson().toJson(controlBean), 
        new IAsyncCallback.Stub() {
        @Override
        public void onResult(String result) throws RemoteException {
            Log.d(TAG, result);
        }
    });
} catch (RemoteException e) {
    e.printStackTrace();
}

3.2.3 Set Screen Timeout

Property

Description

Method

sendAMCommandAsyn(String json, IAsyncCallback callback)

Function

Set Screen Timeout

API Restriction

Android 15

Parameter

json:{"oemConfig":{"screenTimeout":"2000"}}
callback:Callback
Note:screenTimeout:String Timeout (milliseconds)

Example

JsonObject controlBean = new JsonObject();
JsonObject oemConfig = new JsonObject();
controlBean.add("oemConfig", oemConfig);
oemConfig.addProperty("screenTimeout", "2000");
try {
    mDeviceManager.sendAMCommandAsyn(new Gson().toJson(controlBean), 
        new IAsyncCallback.Stub() {
        @Override
        public void onResult(String result) throws RemoteException {
            Log.d(TAG, result);
        }
    });
} catch (RemoteException e) {
    e.printStackTrace();
}

3.2.4 Set Floating Window Permission

Property

Description

Method

sendAMCommandAsyn(String json, IAsyncCallback callback)

Function

Set Floating Window Permission

API Restriction

Android 15

Parameter

json:{"oemConfig":{"setAppsHaveAlertWindowPermiss":"com.example.app"}}
callback:Callback
Note:packageName:String Package name

Example

JsonObject controlBean = new JsonObject();
JsonObject oemConfig = new JsonObject();
JsonObject floatWindow = new JsonObject();
controlBean.add("oemConfig", oemConfig);
oemConfig.add("setAppsHaveAlertWindowPermiss", "com.example.app");
try {
    mDeviceManager.sendAMCommandAsyn(new Gson().toJson(controlBean), 
        new IAsyncCallback.Stub() {
        @Override
        public void onResult(String result) throws RemoteException {
            Log.d(TAG, result);
        }
    });
} catch (RemoteException e) {
    e.printStackTrace();
}

3.2.5 Open Cash Drawer

Property

Description

Method

sendAMCommandAsyn(String json, IAsyncCallback callback)

Function

Open Cash Drawer

Parameter

json:{"peripheralConfig":{"openCashBox":true}}
callback:Callback
Note:openCashBox set to true to open

Example

JsonObject controlBean = new JsonObject();
JsonObject peripheral = new JsonObject();
controlBean.add("peripheralConfig", peripheral);
peripheral.addProperty("openCashBox", true);
try {
    mDeviceManager.sendAMCommandAsyn(new Gson().toJson(controlBean), 
        new IAsyncCallback.Stub() {
        @Override
        public void onResult(String result) throws RemoteException {
            Log.d(TAG, result);
        }
    });
} catch (RemoteException e) {
    e.printStackTrace();
}

3.2.6 Set Main Screen Brightness

Property

Description

Method

sendAMCommandAsyn(String json, IAsyncCallback callback)

Function

Set Main Screen Brightness

API Restriction

Android 15

Parameter

json:{"peripheralConfig":{"screenBrightness":"3"}}
callback:Callback
Note:screenBrightness:String Brightness value (0-255)

Example

JsonObject controlBean = new JsonObject();
JsonObject peripheralConfig = new JsonObject();
controlBean.add("peripheralConfig", peripheralConfig);
oemConfig.addProperty("screenBrightness", "3");
try {
    mDeviceManager.sendAMCommandAsyn(new Gson().toJson(controlBean), 
        new IAsyncCallback.Stub() {
        @Override
        public void onResult(String result) throws RemoteException {
            Log.d(TAG, result);
        }
    });
} catch (RemoteException e) {
    e.printStackTrace();
}

3.2.7 Set Secondary Screen Brightness

Property

Description

Method

sendAMCommandAsyn(String json, IAsyncCallback callback)

Function

Set Secondary Screen Brightness

API Restriction

Android 15

Parameter

json:{"peripheralConfig":{"subScreenBrightness":"3"}}
callback:Callback
Note:subScreenBrightness:String Brightness value (0-255)

Example

JsonObject controlBean = new JsonObject();
JsonObject peripheralConfig = new JsonObject();
controlBean.add("peripheralConfig", peripheralConfig);
oemConfig.addProperty("subScreenBrightness", "3");
try {
    mDeviceManager.sendAMCommandAsyn(new Gson().toJson(controlBean), 
        new IAsyncCallback.Stub() {
        @Override
        public void onResult(String result) throws RemoteException {
            Log.d(TAG, result);
        }
    });
} catch (RemoteException e) {
    e.printStackTrace();
}

3.2.8 Set WiFi Switch

Property

Description

Method

sendAMCommandAsyn(String json, IAsyncCallback callback)

Function

Set WiFi Switch

Parameter

json:{"oemConfig":{"setWifiSwitch":true}}
callback:Callback
Note:setWifiSwitch:boolean true to enable, false to disable

Example

JsonObject controlBean = new JsonObject();
JsonObject oemConfig = new JsonObject();
controlBean.add("oemConfig", oemConfig);
oemConfig.addProperty("setWifiSwitch", true);
try {
    mDeviceManager.sendAMCommandAsyn(new Gson().toJson(controlBean), 
        new IAsyncCallback.Stub() {
        @Override
        public void onResult(String result) throws RemoteException {
            Log.d(TAG, result);
        }
    });
} catch (RemoteException e) {
    e.printStackTrace();
}

3.2.9 Set Bluetooth Switch

Property

Description

Method

sendAMCommandAsyn(String json, IAsyncCallback callback)

Function

Set Bluetooth Switch

Parameter

json:{"oemConfig":{"setBlueToothSwitch":true}}
callback:Callback
Note:setBlueToothSwitch:boolean true to enable, false to disable

Example

JsonObject controlBean = new JsonObject();
JsonObject oemConfig = new JsonObject();
controlBean.add("oemConfig", oemConfig);
oemConfig.addProperty("setBlueToothSwitch", true);
try {
    mDeviceManager.sendAMCommandAsyn(new Gson().toJson(controlBean), 
        new IAsyncCallback.Stub() {
        @Override
        public void onResult(String result) throws RemoteException {
            Log.d(TAG, result);
        }
    });
} catch (RemoteException e) {
    e.printStackTrace();
}

3.2.10 Show/Hide Status Bar

Property

Description

Method

void setHideStatusBar(Context context, boolean hide)

Function

Show/Hide Status Bar

Parameter

context:Context
hide:false to show, true to hide

Example

mDeviceManager.setHideStatusBar(UIControlActivity.this, false);

3.2.11 Show/Hide Navigation Bar

Property

Description

Method

void setHideNavigationBar(Context context, boolean hide)

Function

Show/Hide Navigation Bar

Parameter

context:Context
hide:false to show, true to hide

Example

mDeviceManager.setHideNavigationBar(UIControlActivity.this, false);

3.2.12 Silent Install APK

Property

Description

Method

sendAMCommandAsyn(String json, IAsyncCallback callback)

Function

Silent Install APK

API Restriction

Android 15

Parameter

json:{"oemConfig":{"installApkPackage":"cn.wch.usbdemo","installApkPath":"/sdcard/com.example.deletefile/usbTest.apk","isLaunchAfterInstallation":true,"isDeleteAfterInstallation":true}}
callback:Callback
Note:
installApkPath:APK installation path
installApkPackage: apkPackage name
isLaunchAfterInstallation :Set whether to open after installation
true: Open app
false: Don't open app
isDeleteAfterInstallation:Whether to delete APK after installation
true: Delete APK
false: Don't delete APK

Example

JsonObject controlBean = new JsonObject();
JsonObject oemConfig = new JsonObject();
controlBean.add("oemConfig", oemConfig);
oemConfig.addProperty("installApkPackage", "cn.wch.usbdemo");
oemConfig.addProperty("installApkPath", "/sdcard/com.example.deletefile/usbTest.apk");
oemConfig.addProperty("isLaunchAfterInstallation", true);
oemConfig.addProperty("isDeleteAfterInstallation", true);
try {
    mDeviceManager.sendAMCommandAsyn(new Gson().toJson(controlBean), 
        new IAsyncCallback.Stub() {
        @Override
        public void onResult(String result) throws RemoteException {
            Log.d(TAG, result);
        }
    });
} catch (RemoteException e) {
    e.printStackTrace();
}

3.2.13 Set Permission Grant

Property

Description

Method

sendAMCommandAsyn(String json, IAsyncCallback callback)

Function

Set Permission Grant

API Restriction

Android 15

Parameter

json:{"oemConfig":{"defaultPermissionPolicy":{"permissionStatus":true,"permissionPkg":"com.device.manager.demo","permissionName":"android.permission.WRITE_EXTERNAL_STORAGE"}}}
callback:Callback
Note:
Grant single permission
permissionPkg Package name String
permissionName Permission name String
permissionStatus Whether to authorize true / false

Example

JsonObject controlBean = new JsonObject();
JsonObject oemConfig = new JsonObject();
JsonObject permissionPolicy = new JsonObject();
controlBean.add("oemConfig", oemConfig);
oemConfig.add("defaultPermissionPolicy", permissionPolicy);
permissionPolicy.addProperty("permissionStatus", true);
permissionPolicy.addProperty("permissionName", "android.permission.WRITE_EXTERNAL_STORAGE");
permissionPolicy.addProperty("permissionPkg", "com.example.iminlibsdemo");
try {
    mDeviceManager.sendAMCommandAsyn(new Gson().toJson(controlBean), 
        new IAsyncCallback.Stub() {
        @Override
        public void onResult(String result) throws RemoteException {
            Log.d(TAG, result);
        }
    });
} catch (RemoteException e) {
    e.printStackTrace();
}

3.2.14 Grant All Declared Permissions

Property

Description

Method

sendAMCommandAsyn(String json, IAsyncCallback callback)

Function

Grant All Declared Permissions

API Restriction

Android 15

Parameter

json:{"OEMApplicationPolicy":[{"packageName":"com.example.iminlibsdemo","allRuntimePermissionPolicy":"GRANT"}]}
callback:Callback
Note:
packageName Package name String
allRuntimePermissionPolicy Whether to authorize
GRANT :Grant permission
DENY : Deny permission

Example

JsonObject controlBean = new JsonObject();
JsonArray OEMApplicationPolicy = new JsonArray();
controlBean.add("OEMApplicationPolicy", OEMApplicationPolicy);
JsonObject item = new JsonObject();
item.addProperty("packageName", "com.example.iminlibsdemo");
item.addProperty("allRuntimePermissionPolicy", "GRANT");
OEMApplicationPolicy.add(item);
try {
    mDeviceManager.sendAMCommandAsyn(new Gson().toJson(controlBean), 
        new IAsyncCallback.Stub() {
        @Override
        public void onResult(String result) throws RemoteException {
            Log.d(TAG, result);
        }
    });
} catch (RemoteException e) {
    e.printStackTrace();
}

3.2.15 Set App to Start on Boot by Package Name

Property

Description

Method

sendAMCommandAsyn(String json, IAsyncCallback callback)

Function

Set App to Start on Boot by Package Name

API Restriction

Android 15

Parameter

json:{"OEMApplicationPolicy":[{"packageName":"com.example.iminlibsdemo","setAppStartOnBoot":true}]}
callback:Callback
Note:
packageName Package name String
setAppStartOnBoot
true :Start on boot
false :Cancel start on boot

Example

JsonObject controlBean = new JsonObject();
JsonArray OEMApplicationPolicy = new JsonArray();
controlBean.add("OEMApplicationPolicy", OEMApplicationPolicy);
JsonObject item = new JsonObject();
item.addProperty("packageName", "com.example.iminlibsdemo");
item.addProperty("setAppStartOnBoot", true);
OEMApplicationPolicy.add(item);
try {
    mDeviceManager.sendAMCommandAsyn(new Gson().toJson(controlBean), 
        new IAsyncCallback.Stub() {
        @Override
        public void onResult(String result) throws RemoteException {
            Log.d(TAG, result);
        }
    });
} catch (RemoteException e) {
    e.printStackTrace();
}

3.2.16 Set System Time and Timezone

Property

Description

Method

sendAMCommandAsyn(String json, IAsyncCallback callback)

Function

Set System Time and Timezone

API Restriction

Android 15

Parameter

json:{"oemConfig":{"setTime":1767086226000,"setTimeZone":"Asia/Shanghai"}}
callback:Callback
Note:
setTime Set time, unit milliseconds long
setTimeZone Set timezone String
Must use values from TimeZone.getAvailableIDs()

Example

JsonObject controlBean = new JsonObject();
JsonObject oemConfig = new JsonObject();
controlBean.add("oemConfig", oemConfig);
oemConfig.addProperty("setTime", 1767086226000L);
oemConfig.addProperty("setTimeZone", "Asia/Shanghai");
try {
    mDeviceManager.sendAMCommandAsyn(new Gson().toJson(controlBean), 
        new IAsyncCallback.Stub() {
        @Override
        public void onResult(String result) throws RemoteException {
            Log.d(TAG, result);
        }
    });
} catch (RemoteException e) {
    e.printStackTrace();
}

3.3 Psam

3.3.1 Configure Psam Parameters

Property

Description

Method

iccDevParaSet(Context context, byte slot, byte clkSel, byte mode, byte pps)

Function

Configure Psam Parameters

Parameter

context:Context
slot:Card channel number byte
clkSel:byte
mode:byte
pps:byte

Example

byte slot = 0x01;
mDeviceManager.iccDevParaSet(context, slot, (byte) 0, (byte) 0, (byte) 0);

3.3.2 Open Psam

Property

Description

Method

int openPsam(Context context, byte slot, byte vccMode, byte[] ATR)

Function

Open Psam

Parameter

slot:Card channel number
vccMode:Specified card power supply voltage value
ATR:Card reset response (requires at least 32+1 bytes of space), content is length (1 byte) + reset response content

Example

byte[] atr = new byte[40];
byte slot = 0x01;
mDeviceManager.openPsam(context, slot, (byte) 1, atr);

3.3.3 Close Psam

Property

Description

Method

int closePsam(Context context, byte slot)

Function

Close Psam

Parameter

context:Context
slot:Card channel number

Example

byte slot = 0x01;
mDeviceManager.closePsam(context, slot);

3.3.4 Send Psam Command

Property

Description

Method

int sendPsamCommand(Context context, byte slot, byte[] apduSend, byte[] apduRecv)

Function

Send Psam Command

Parameter

context:Context
slot:Card channel number
apduSend:APDU sent to card
apduRecv:APDU received from card

Example

byte slot = 0x01;
byte[] apduSend = new byte[600];
byte[] apduRecv = new byte[600];
apduSend[0] = = (byte) 0x00;
apduSend[1] = = (byte) 0xa4;
apduSend[2] = = (byte) 0x04;
apduSend[3] = = (byte) 0x00;
apduSend[4] = = (byte) 0x00;
apduSend[5] = = (byte) 0x0e;
System.arraycopy("1PAY.SYS.DDF01".getBytes(), 0, apduSend, 6, 14);
mDeviceManager.commandPsam(context, slot, apduSend, apduRecv);

3.3.5 Send Psam Command (new)

Property

Description

Method

byte[] sendPsamCommandNew(Context context, byte slot, byte[] sendData)

Function

Send Psam Command (new version)

Parameter

context:Context
slot:Card channel number
apduSend:APDU sent to card
apduRecv:APDU received from card

Example

byte slot = 0x01;
byte[] apduSend = new byte[600];
byte[] apduRecv = new byte[600];
apduSend[0] = = (byte) 0x00;
apduSend[1] = = (byte) 0xa4;
apduSend[2] = = (byte) 0x04;
apduSend[3] = = (byte) 0x00;
apduSend[4] = = (byte) 0x00;
apduSend[5] = = (byte) 0x0e;
System.arraycopy("1PAY.SYS.DDF01".getBytes(), 0, apduSend, 6, 14);
mDeviceManager.sendPsamCommandNew(context, slot, apduSend, apduRecv);

3.4 USB Light

3.4.1 Get Device

Property

Description

Method

UsbDevice getLightDevice(Context context)

Function

Get Device

Example

mDeviceManager.getLightDevice(context)

3.4.2 Connect Device

Property

Description

Method

boolean connectLightDevice(Context context)

Function

Connect USB Light Device

Parameter

context:Context

Example

UsbDevice device = mDeviceManager.getLightDevice(context);
mDeviceManager.connectLightDevice(context);

3.4.3 Turn On USB Green Light

Property

Description

Method

void turnOnGreenLight(Context context)

Function

Turn On USB Green Light

Example

mDeviceManager.turnOnGreenLight(context)

3.4.4 Turn On USB Red Light

Property

Description

Method

void turnOnRedLight(Context context)

Function

Turn On USB Red Light

Example

mDeviceManager.turnOnRedLight(context)

3.4.5 Turn Off USB Light

Property

Description

Method

void turnOffLight(Context context)

Function

Turn Off USB Light

Example

mDeviceManager.turnOffLight(context)

3.4.6 Disconnect Device

Property

Description

Method

void disconnectLightDevice(Context context)

Function

Disconnect USB Light Device

Parameter

context:Context

Example

mDeviceManager.disconnectLightDevice(context);

4. Device Information Return Data Reference Table

Class Name: HardwareInfo

Device hardware related information. Fields related to temperature thresholds are only available when hardwareStatusEnabled in device policy is true.

Field

Type

Field Length

Required

Description

brand

String

128

Yes

Device brand. For example, Google.

hardware

String

128

No

Hardware name. For example, Angler.

deviceBasebandVersion

String

128

No

Baseband version. For example, MDM9625_104662.22.05.34p.

manufacturer

String

128

No

Manufacturer. For example, imin.

serialNumber

String

128

No

Device serial number.

model

String

128

No

Device model. For example, I25D01.

deviceName

String

128

No

Device name, for example Swift 2 Pro

batteryShutdownTemperatures

Number[]

10

No

Battery shutdown temperature threshold (in degrees Celsius) for each battery on the device.

cpuShutdownTemperatures

Number[]

10

No

CPU shutdown temperature threshold (in degrees Celsius) for each CPU on the device.

cpuThrottlingTemperatures

Number[]

10

No

CPU throttling temperature threshold (in degrees Celsius) for each CPU on the device.

gpuShutdownTemperatures

Number[]

10

No

GPU shutdown temperature threshold (in degrees Celsius) for each GPU on the device.

gpuThrottlingTemperatures

Number[]

10

No

GPU throttling temperature threshold (in degrees Celsius) for each GPU on the device.

skinShutdownTemperatures

Number[]

10

No

Device skin shutdown temperature threshold (in degrees Celsius).

skinThrottlingTemperatures

Number[]

10

No

Device skin throttling temperature threshold (in degrees Celsius).

enterpriseSpecificId

String

128

No

Output only. ID used to uniquely identify personally-owned devices in a specific organization. After registering to the same organization on the same physical device, this ID remains valid even after settings and factory resets. This ID applies to personally-owned devices with work profiles (devices running Android 12 and higher).

Class Name: NetworkInfo

Device network information

Field

Type

Field Length

Required

Description

imei

String

128

Yes

IMEI number of GSM device. For example, A1000031212.

meid

String

128

Yes

MEID number of CDMA device. For example, A00000292788E1.

wifiMacAddress

String

128

No

Device Wi-Fi MAC address. For example, 7c:11:11:11:11:11.

telephonyInfos

TelephonyInfo[]

10

No

Provides telephone information associated with each SIM card on the device.

Class Name: TelephonyInfo

Telephone information related to the specified SIM card on the device. Only supported on fully managed devices with Android API level 23 and above.

Field

Type

Field Length

Required

Description

phoneNumber

String

32

No

Phone number associated with this device (if any).

carrierName

String

128

No

Carrier name.

Class Name: SoftwareInfo

Device software related information

Field

Type

Field Length

Required

Description

androidVersion

String

128

Yes

User-visible Android version string

androidBuildNumber

String

128

No

Android build ID string intended to be displayed to the user.

deviceKernelVersion

String

64

No

Kernel version, for example 2.6.32.9-g103d848.

bootloaderVersion

String

128

No

System bootloader version number, for example 0.6.7

securityPatchLevel

String

128

No

Security patch level, for example 2016-05-01.

androidBuildTime

String

128

No

Build time. Timestamp in RFC3339 UTC (Coordinated Universal Time, "Zulu") format, accurate to nanoseconds with up to nine decimal places. Examples: "2014-10-02T15:01:23Z" and "2014-10-02T15:01:23.045123456Z".

primaryLanguageCode

String

128

No

IETF BCP 47 language code for the primary language locale on the device.

deviceBuildSignature

String

128

No

SHA-256 hash of the android.content.pm.Signature associated with the system software package, which can be used to verify that the system build has not been modified.

Class Name: DisplayInfo

Device display information

Field

Type

Field Length

Required

Description

name

String

128

Yes

Display device name.

displayId

Integer

32

Yes

Unique display ID.

width

Integer

32

No

Screen width (pixels).

height

Integer

32

No

Screen height (pixels).

density

Integer

32

No

Screen density (DPI).

refreshRate

Integer

32

Yes

Display refresh rate (in frames per second).

state

String

128

No

Screen state.
DISPLAY_STATE_UNSPECIFIED: This value is not allowed.
OFF: Display is off.
ON: Display is on.
DOZE: Display is dozing in low power state.
SUSPENDED: Display is dozing due to suspended low power state.

Class Name: MemoryInfo

Device memory and storage space information

Field

Type

Field Length

Required

Description

totalRam

String

32

No

Total RAM capacity on the device (in bytes).

totalInternalStorage

String

32

No

Total internal storage space on the device (in bytes)

Class Name: MemoryDetail

Device memory information details

Field

Type

Field Length

Required

Description

totalMemory

String

32

Yes

Total memory

freeMemory

String

32

Yes

Free memory - unallocated memory

availableMemory

String

32

No

Available memory = unallocated memory + reclaimable memory. Available memory is primarily based on this property

usedMemory

String

32

No

used memory

buffers

String

32

No

Buffer is designed to handle read/write speed differences between CPU and block devices. Buffers statistics represent the total size of this buffer memory. This memory can be reclaimed through drop cache.

cached

String

32

No

Cached is used for file cache, excluding swapcache and buffers. Cached = file pages - swapcache - buffers, approximately equal to Active(file) + Inactive(file)

swapTotal

String

32

No

swap total

swapFree

String

32

No

swap free

shmem

String

32

No

Shmem is the number of memory pages shared by processes and memory used by tmpfs. Tmpfs uses physical memory to provide RAM disk functionality. When saving files on tmpfs, the file system temporarily saves them to disk cache, so it belongs to the "buffers+cached" category corresponding to disk cache. However, since there is no corresponding content on disk, it is not recorded in the LRU list corresponding to file-backed memory, but in the LRU table of anonymous memory. This is the origin of the formula: buffers + cached = Active(file) + Inactive(file) + Shmem

sreclaimable

String

32

No

Sreclaimable count - amount of Slab that can be reclaimed. When calling kmem_getpages() with SLAB_RECLAIM_ACCOUNT flag, it indicates reclaimable and is counted in SReclaimable, otherwise counted in SUnreclaim.

swap

String

32

No

swap

Class Name: CPUDetail

CPU information

Field

Type

Field Length

Required

Description

model

String

128

Yes

model

manufacturer

String

128

No

manufacturer Name

totalCPU

String

128

No

CPU total hertz

usedCPU

String

128

No

CPU used hertz

cores

String

128

No

Number of cores

cpuList

List<CPUItem>

128

No

CPU cluster. sys/devices/system/cpu/cpufreq/policyXX represents the cluster path

-- frequency

String

128

No

Current frequency sys/devices/system/cpu/cpufreq/policyX/scaling_cur_freq

-- minfreq

String

128

No

Current minimum frequency sys/devices/system/cpu/cpufreq/policyX/scaling_min_freq

-- maxfreq

String

128

No

Current maximum frequency sys/devices/system/cpu/cpufreq/policyX/cpuinfo_max_freq

-- frequencyList

List<String>

N

No

Supported frequencies sys/devices/system/cpu/cpufreq/policyX/scaling_available_frequencies

-- mode

String

128

No

Current mode sys/devices/system/cpu/cpufreq/policyX/scaling_governor

-- modeList

List<String>

128

No

Supported modes sys/devices/system/cpu/cpufreq/policyX/scaling_available_governors

-- online

String

128

No

Online status /sys/devices/system/cpu/cpuX/online

Class Name: StorageDetail

Device storage space detailed information

Field

Type

Field Length

Required

Description

id

String

-

No

Storage unique identifier

availableStorage

String

-

No

Available storage size

totalStorage

String

-

No

Total storage size

usedStorage

String

-

No

Used storage size

volumes

StorageVolume

-

No

Storage volume information

Class Name: StorageVolume

Storage volume information

Field

Type

Field Length

Required

Description

type

String

-

No

Volume name

fsType

String

-

No

Type

state

String

-

No

Current state of the volume

fsUuid

String

-

No

Storage volume unique identifier

path

String

-

No

Volume mount point path

5. Flutter & RN

5.1 Flutter

For Flutter developers, iMin provides a Flutter plugin to access device hardware capabilities.

Demo Reference: https://github.com/iminsoftware/FlutterApiTest

API Plugin: https://pub.dev/packages/imin_hardware_plugin

5.2 React Native

For React Native developers, iMin provides a React Native plugin to access device hardware capabilities.

Demo Reference: https://github.com/iminsoftware/ReactNativeApiTest

API Plugin: https://www.npmjs.com/package/react-native-imin-hardware