3 Replies Latest reply on Dec 12, 2017 9:08 AM by Darryn Campbell

    My DataWedge Keystroke output app works on TC51 but not TC20

    Sam Ross

      I've been working on an app primarily being tested on TC51 devices. I use a DataWedge profile set up with barcode scanning and keystroke output (no intent output) and it works brilliantly on my TC51.

       

      In MainActivity.java, I override dispatchKeyEvent(KeyEvent event) and get the character entered and keycode from there, and process it according to my app's needs. I can provide source code if needed.

       

      This works great on my TC51 but now that I've installed my app on a TC20, it's not doing anything at all. I've tried logging what keys get pressed (in my dispatchKeyEvent, i check if it's ACTION_UP and then I log the keycode in my app) but that just produces a list of "285" keycode presses, which doesn't match anything in KeyEvent.Java

       

      How can I get my app working with Keystroke output on the TC20?

        • Re: My DataWedge Keystroke output app works on TC51 but not TC20
          Darryn Campbell

          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.