The aim of this document is to assist you in retrieving device information from your custom application running on the Nomba Android terminal. If you encounter any difficulties with this process, feel free to reach out for support.

Retrieve device info - available since NombaX Application v1.6.2

This following code snippet serves as a foundation for retrieving device information on the Nomba terminal.

import android.content.Intent;
import androidx.activity.result.ActivityResultContracts;
import androidx.activity.result.ActivityResultLauncher;
import androidx.lifecycle.MutableLiveData;

const val TERMINAL_ID = "terminalId"
const val SERIAL_NO = "serialNo"
const val DEVICE_INFO_ARGUMENTS = "deviceInfoArguments"
const val DEVICE_INFO_RESULT = "deviceInfoResult"
const val DEVICE_INFO_INTENT = ""

val resultString = mutableStateOf("")
var deviceInfoResult = HashMap<String, String>()
val gson = GsonBuilder()

//setup a launcher that would help launch the intent
var deviceInfoResultLauncher = registerForActivityResult(
) { result ->
    val data: Intent? =
    if (result.resultCode == Activity.RESULT_OK) {
        val type = object : TypeToken<HashMap<String, Any>>() {}.type
        val resultJson = data?.getStringExtra(DEVICE_INFO_RESULT)
        deviceInfoResult = gson.fromJson(resultJson, type)

        val terminalId = deviceInfoResult[TERMINAL_ID]
        val serialNo = deviceInfoResult[SERIAL_NO]
        resultString.value = "Terminal Id: $terminalId Serial No: $serialNo"

//setup an intent to be triggered
val intent = Intent(DEVICE_INFO_INTENT)

//pass the terminalId and serialNo as extra data

//launch the intent

Your resultString should look like;

Terminal Id: 2KUD4AKB Serial No: 1234567890