Cordova application keyboard input issue (KitKat vs. JellyBean)

// Expert user has replied.
Z Zim Zaman 3 years 7 months ago
7 6 0

Hello,
 
Reaching out on behalf of a customer who is having issue with their hybrid application written in the Cordova platform.
 
The device they have been testing with has been a TC55 JellyBean and their app (attached + source) accepts scanner input without any issues.
 
However, upon testing their application any Zebra KitKat device, their app is not displaying the scan data.
 
Also, in JB, they don't have the keyboard pop up for the text field. However, in KK, it does so by default. The customer is requesting that the keyboard non pop up for the text field.
 
They're using the stock Profile0 Datawedge profile. They do not want (or may not be able to) leverage native Datawedge API calls. They essentially want to accept keyboard input.
 
Any suggestions would be appreciated. Attached is a sample app to represent what they are trying to accomplish. Please reference the ASC_BarCodeScanner.js file in the source (/assets/www/) to reference the customer code.

Please Register or Login to post a reply

6 Replies

R Robert Galvin

here is an updated sample of hiding the SIP after it appears. I do not see a way of preventing it from popping up selectively for fields.

S Sudip Pal

Hi All,

I will explain issue in brief:
Our requirement is to build a hybrid application with agnostic code that will do the following:

Multiple screens will have requirement to capture barcode by pressing the hardware scanner button in TC 55.
These barcodes can be one per screen or multiple per screen.
These screens will have text boxes or text areas only for manually providing input.
1 barcode per screen will be shown in a text box & multiple barcode per screen will be shown in text area with a delimiter.
As per usability design when the screens load, the text box/text area will not have focus. However user can still scan the barcode value & that value should appear in the text box. This is a must have feature.
The decoded barcode value is being put into the text boxes & text areas to provide the user to manually modify the value. This will be a rare scenario & normally users won’t be required to do that.

The code that is being shared was working perfectly in Jellybean. With the keypress event, we were able to capture the barcode value one at a time with keyCode attribute. This keyCode value in Kitkat is coming as 0.

If you find solution for the problem, share with Marcela. She will drop a mail to us.

Edit: I have modified the sample code. Please find it attached.

R Robert Galvin

Sorry actually - commenting out the onkeydown="onKeyPress(event)" works fine.

What is it trying to do with each keystroke? Datawedge sends each character one at a time, so each digit in the barcode will trigger this event. I would suggest that you do some processing after the value changes.

If you are trying to ensure that the barcode is meeting a certain pattern there are much better ways to do this with Angular using ng-message and the use of $invalid, $dirty, $pristine.

R Robert Galvin

Attached is a barebones Cordova project that works on TC55KK with Datawedge. I am looking at differences and why there application is not working. Stay tuned. Possibly the keyboard plugin they are using is getting in the way.

R Robert Galvin

Some more findings:

Commenting out:

Results in a scan, but only one character is pasted

Leaving that commented and then commenting out:

Has scanning working with all characters being put in text box

Then oddly putting the mqttws31.js back in but leaving the ASC_Constants.js file commented - chops off the first character

I have no idea why it is different from JB to KK, but it is possible that these libraries behave differently on KK - Looks like they are responsible for some type of processing of keyboard input,

In all of my testing so far the SIP opens - I will look at that next to demonstrate how to hide it

Z Zim Zaman

Customer is requesting an answer by Wednesday (3/25), any help would be sincerely appreciated.

CONTACT
Can’t find what you’re looking for?