Datawege send enable barcode command takes 2 seconds, which is too long for us.
TC21 (Android 11) + RFD4030
What are we doing:
When a user comes on a screen, where a barcode needs to be scanned, we active it with this command:
private fun sendDataWedgeIntentWithExtra( action: String = DATAWEDGE_ACTION, extraKey: String, //"com.symbol.datawedge.api.SCANNER_INPUT_PLUGIN" extraValue: String //"ENABLE_PLUGIN" ) { val intent = Intent().apply { setAction(action) putExtra(extraKey, extraValue) } app().applicationContext.sendBroadcast(intent)
}
This takes up to 2 seconds. After this 2 seconds with the trigger of the RDF4030 the barcode scanner can be activated.
I know Intents are native Android codes, but can you improve this?
Accepted Solution
Ok, it seems that with the DataWedge and Android, we can't increase the speed of enabling and disabling barcode scanner. However with suspend and resume we are able to. So at the very beginning of showing the reading fragment, we send the enable command and at the end of the fragment, we send the disable command. And in the meanwhile we use the suspend and resume functionality.
Btw this was also reproduced in the Zebra's DataWedge App
2 Replies
Ok, it seems that with the DataWedge and Android, we can't increase the speed of enabling and disabling barcode scanner. However with suspend and resume we are able to. So at the very beginning of showing the reading fragment, we send the enable command and at the end of the fragment, we send the disable command. And in the meanwhile we use the suspend and resume functionality.
Btw this was also reproduced in the Zebra's DataWedge App
Suspending and Resuming the Scanning capability is the preferred method.
Enabling and Disabling the Scanning framework is kind of an heavyweight load /unload.
* snip * from the Techdoc: https://techdocs.zebra.com/datawedge/11-0/guide/programmers-guides/dw-programming/
*/snip *