1. Home
  2. Docs
  3. Handheld Common
  4. RFID
  5. Scan activity

Scan activity

The RFID V2 app provides a new activity that you can call if you want to receive data in your code, but do not want to build your own user interface.

You can start the activity with startActivityForResult and data will be returned in onActivityResult. This means that this feature is also compatible with the newer Activity Result APIs.

The activity is started with startActivityForResult:

If the app has not been configured for a specific module, you will need to provide a string extra with the key module. See below for possible values.

There are other optional string extras that you can provide:

Key Description
message A message to show to the user. Default is empty
title Title shown in the window. Default is “RFID Scan”
cancel Text for the cancel button. Default is “Cancel”
color Accent color in “#XXXXXX” format. Default is “#2e99d5”

 

After a successful scan, any error, if the user pressed “Cancel”, or when the user pressed the back button, the activity closes
and triggers onActivityResult on the activity that called startActivityForResult.

The resultCode code will be RESULT_CANCELED if the user canceled the scan and RESULT_OK in any other case.
The data parameter contains a boolean extra with the success which indicates a successful scan or and error.
If the scan was successful, the string extra id contains the ID of the tag. Otherwise the string extra error contains the error message that occurred.

Options for module extra

Both the startService and startActivityForResult intent support a module extra with one of
the following values.

  • NX2-1030: For the Elatec Module on the Nautiz X2 with Android 6, 7, or 11
  • NX2EXP-LF: For the iDTRONIC IDT01 on the Nautiz X2 with Android 6, 7, or 11
  • NX2-EU-1043: For the Pistol Grip UHF (EU) on the Nautiz X2 with Android 6, 7, or 11
  • NX2-NA-1043: For the Pistol Grip UHF (NA) on the Nautiz X2 with Android 6, 7, or 11
  • NX6EXP-LF01: For the Agrident Module on the Nautiz X6v1 with Android 8
  • NX6EXP-LF02: For the Elatec Module on the Nautiz X6v1 with Android 8
  • NX6V2EXP-LF01: For the Agrident Module on the Nautiz X6v2 with Android 11
  • NX6V2EXP-LF02: For the Elatec Module on the Nautiz X6v2 with Android 11