I suspect this is not device specific but rather Android version specific, i.e. something that changed between M and N. I did a similar test with a TC51 N device and dispatchKeyEvent did not fire.
DataWedge is not sending KeyEvents for each of the individual characters in the barcode but is only designed to work with text fields which is why this behaviour was never tested.
I spoke with the team & they are keen to understand the issue better (even if it is just better documenting exactly how the behaviour is supposed to work),
- If you could please provide your source code it would help understanding the specific issue
- If you could please let us know why the Intent mechanism was not acceptable for your application? Typically I would expect applications that required DataWedge input without text fields to use Intents.
Thank you Darryn
I've used Keyboard output thus far mostly because it was just easier. I was really struggling to get intents working, as the guides seem a bit over-complicated for an app that *merely needs to scan barcodes*. I found them hard to follow and when I tried following them to the letter, I ended up with an app that just wasn't receiving the data.
Whereas accepting keyboard output by overriding dispatchKeyEvent was very simple.
I'd prefer using an intent to be honest but it's just been a very frustrating experience.
It's a webview app. The source code links:
It does sound like Intents are the best way forward in your case. I have a basic sample on my github to receive a scan via an intent (GitHub - darryncampbell/DataWedge-Intent-Example-1 ) if that helps. I'll probably write a blog around it at some point as it's a question we frequently get.