Get Device Information

Method: POST

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.

Request parameters

ParameterDescriptionExample
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

ParameterDescriptionExample
Device serial numberReturns the serial number of the device.N7NL00411280
Firmware versionReturns the current firmware of the device.V.2.3.00
Modelstring 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();
    }
  };
};