-
Re: My DataWedge Keystroke output app works on TC51 but not TC20
Darryn CampbellDec 12, 2017 12:04 AM (in response to Sam Ross)
Hi,
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.
Thanks,
Darryn.
-
Re: My DataWedge Keystroke output app works on TC51 but not TC20
Sam Ross Dec 12, 2017 6:42 AM (in response to Darryn Campbell)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:
-
Re: My DataWedge Keystroke output app works on TC51 but not TC20
Darryn CampbellDec 12, 2017 9:08 AM (in response to Sam Ross)
If you are using an embedded WebView you might also consider our Enterprise Browser product as that exposes a Barcode API through JavaScript in an embedded WebView but I presume such a drastic change would be unacceptable at this stage in your development.
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.
-
Re: My DataWedge Keystroke output app works on TC51 but not TC20
Sam Ross Dec 14, 2017 2:24 AM (in response to Darryn Campbell)I followed your example code and got intents working. Now able to send the barcode intents into my webview. It's actually exceedingly simple to get accepting intents working, I don't understand why the guides are so complicated.
Thank you!
-
Re: My DataWedge Keystroke output app works on TC51 but not TC20
Edward CorreiaDec 15, 2017 7:23 AM (in response to Sam Ross)
Hi Sam-
My name is Eddie Correia, and I'm responsible for the DataWedge docs on Techdocs. I'm glad you were able to get DataWedge working the way you wanted, and I'm sorry that our docs seemed complicated and/or weren't helpful.
If I might, I'd like to request that you provide some specific feedback on where and how we might improve or simplify the docs. Our goal is to make DataWedge guides easier for developers to use, and direct input from developers is an invaluable part of that.
Thanks and regards,
Eddie Correia
-
Re: My DataWedge Keystroke output app works on TC51 but not TC20
Sam Ross Dec 15, 2017 7:51 AM (in response to Edward Correia)Sure.
Every time I tried to search for an example, I ended up on this one or one very similar. This exmaple included a 'softscan triggering' tutorial which is (if I understand what it is) unnecessary for my basic needs, and when I tried following the '
onNewIntent
' code, I always ended up unable to get the data in my app.Darryn's code was simple enough that I didn't even need a guide to understand how to apply it to my own app (although it might have been faster if it did have a guide). He makes a private BroadcastReceiver, registers it, and then... that's it. I have to make sure that the intent output string in DataWedge matches the string in the code, and then I'm good to go. I then can pass the information into my webview however I please, using the myWebView.evaluateJavascript() interface.
I came into the docs thinking what I wanted was literally the most basic possible thing you could do with a datawedge, but I couldn't find anything that simple in the tutorials or docs anywhere.
-
Re: My DataWedge Keystroke output app works on TC51 but not TC20
Edward CorreiaDec 15, 2017 9:19 AM (in response to Sam Ross)
1 of 1 people found this helpfulThanks Sam. We will add a simpler tutorial. Feel free to send additional suggestions. -EC
-
Re: My DataWedge Keystroke output app works on TC51 but not TC20
Sam Ross Dec 29, 2017 4:31 AM (in response to Edward Correia)Will you update me when you've made that guide?
-
Re: My DataWedge Keystroke output app works on TC51 but not TC20
Edward CorreiaDec 29, 2017 12:14 PM (in response to Sam Ross)
-
-
-
-
-
-
-