The Get Device InformationAPI is used to device-related information. To get the device related information such as device serial number, device model, device OS pass the parameters as mentioned in the request parameter table.
Warning!
The get device information feature is applicable only for N910 device.
Method: POST
Request parameters
Parameter | Description | Example |
---|---|---|
Handlerβ¨mandatory | handler Handlers are used to passing the data and receiving the data between the two classes. | handler |
DeviceNameβ¨mandatory | string Device name is used to find the device. | DeviceType.N 910 |
addressβ¨Optional | string Connected device mac address. | βXXXXXXX69 09β |
deviceCom mModeβ¨Optional | int Type of communication (USB or bluetooth). | 0 |
Sample request
try {
initialization = new PaymentInitialization(PaymentTransactionActivity.this);
initialization.getDeviceInfo(handler, deviceName, deviceCommMode, address);
} catch (RuntimeException e) {
e.printStackTrace();
}
Response parameters
Parameter | Description | Example |
---|---|---|
Device serial number | Returns the serial number of the device. | N7NL00411280 |
Firmware version | Returns the current firmware of the device. | V.2.3.00 |
Model | string Returns the model number of the device. | N910 |
Sample response
Use this code to fetch the response of this API.
private final Handler handler = new Handler() {
public void handleMessage(android.os.Message msg) {
if (msg.what == DEVICE_INFO) {
DeviceInformation deviceInfo = (DeviceInformation) msg.obj;
Toast.makeText(PaymentTransactionActivity.this, "Device Serail number:
"+deviceInfo.getSerialNumer()+"\
n "+"
Modelnumber: "+deviceInfo.getModelNumber
(), Toast.LENGTH_LONG).show();
finish();
} else if (msg.what == ERROR_MESSAGe) {
Toast.makeText(PaymentTransactionActivity.this, (String) msg.obj, Toast.LENGTH_LONG).show();
finish();
}
};
};