0

Used DataWedge feature to scan the barcode in zebra device and send it back to device using intent.

I used below code to receive scanned data using intent.

override fun onNewIntent(intent: Intent) {
        super.onNewIntent(intent)
        //  DataWedge intents received here
        if (intent.hasExtra(DWInterface.DATAWEDGE_SCAN_EXTRA_DATA_STRING)) {
            Log.v(tag, "onNewIntent()")
            //  Handle scan intent received from DataWedge
            val barcodeData = intent.getStringExtra(DWInterface.DATAWEDGE_SCAN_EXTRA_DATA_STRING)
            Log.v(tag, "scanData: $barcodeData")
        }
    }

I need to know how to handle scanner failure cases & scanner timeout callback?

Gopinathan B
  • 382
  • 1
  • 2
  • 10

1 Answers1

1

There is not an API to let you know the scan has timed out. The best way to achieve this would probably be to use the Register_For_Notification API and detect when the scanner goes from SCANNING to WAITING, if that transition is not accompanied by a successful scan you can assume the scan timed out or the user released the trigger. I have a sample app showing how to register for the scanner state.

Darryn Campbell
  • 1,441
  • 10
  • 13
  • After scanner started scanning then I need to hide progress bar when scanner gets timeout without reading data. Is there any other way to achieve this? – Gopinathan B Jul 14 '20 at 05:18
  • I can't think of any, if I were implementing that I would use the Register_For_Notification API – Darryn Campbell Jul 14 '20 at 06:28