Android Question Barcode scanner with physical keyboard

techgreyeye

Member
Licensed User
Longtime User
I've been asked to port one of my apps that runs on Zebra TC series which use software keyboard, onto Zebra MC series which have a physical keyboard in a phone arrangement.
I have no idea how the interaction with these keyboards works.

Does it just replace the software keyboard, so things like IME_HandleAction events and Activity_KeyPress events are fired as though the software keyboard is being used? Does input just go into an EditText without further changes?

Any pointers would be gratefully received.

Thanks !
 

teddybear

Well-Known Member
Licensed User
I think the virtual keyboard is replaced and the physical keyboard works, you don't care which keyborad is in use
 
Last edited:
Upvote 0

Spavlyuk

Active Member
Licensed User
I'd say it doesn't replace the virtual keyboard but works alongside with it and the user can use either one. You typically don't have to do anything for it to work. However, you can improve how your app works with a physical keyboard with d-pad buttons as the user can interact with views such as buttons or panels. When using the d-pad, a view becomes focused and pressing enter registers a click on the focused view. All this is handled by android but for example, you can manually focus the default button or CLV item so the user doesn't have to navigate to it with the d-pad and is able to immediately press enter.
 
Upvote 0

techgreyeye

Member
Licensed User
Longtime User
I'd say it doesn't replace the virtual keyboard but works alongside with it and the user can use either one. You typically don't have to do anything for it to work. However, you can improve how your app works with a physical keyboard with d-pad buttons as the user can interact with views such as buttons or panels. When using the d-pad, a view becomes focused and pressing enter registers a click on the focused view. All this is handled by android but for example, you can manually focus the default button or CLV item so the user doesn't have to navigate to it with the d-pad and is able to immediately press enter.

That's what I thought. There are settings in Android to disable software keyboard if you have a hardware one.
The reason the user has asked is they can't operate touch screen with gloves on (inside industrial freezers for > 2 hours) and thinks a physical keyboard will help.
I told him to try using a stylus but he seems to want the expensive option.

I'll cheekily tag in @DonManfred in the hope he can confirm this :)
 
Upvote 0

DonManfred

Expert
Licensed User
Longtime User
I'll cheekily tag in @DonManfred in the hope he can confirm this :)
I remember using Zebra Devices. They do have a systemsettingsapp where you can enable sending the scanned code to an editfield.
I only used keyboardless devices but i guess @Spavlyuk is right and you should be able to use it.
Best is if you would had such a device at you to test it by yourself.

Ask your customer to give you such a device for development-time...
 
Upvote 0

Spavlyuk

Active Member
Licensed User
There are settings in Android to disable software keyboard if you have a hardware one.
There's a setting to disable the virtual keyboard, yes. Though I believe it might be a Zebra specific setting as I haven't seen a similar option on other devices.

They do have a systemsettingsapp where you can enable sending the scanned code to an editfield.
The scanned barcode is sent as keystrokes by default. It might be a good idea to enable the send enter option in the datawedge app so that you can automatically handle the barcode input in the EnterPressed event, without needing the users to press enter after scanning the barcode. Though I guess that may depend on how you wish to handle the scanner input.
 
Upvote 0

DonManfred

Expert
Licensed User
Longtime User
Though I believe it might be a Zebra specific setting as I haven't seen a similar option on other devices.
That´s possible. Yes, dataweedge is the name of the device-config-app. I can´t remember it´s name ;-)
Though I guess that may depend on how you wish to handle the scanner input.
That´s correct. You have to choose what best fit to your needs.
 
Upvote 0

techgreyeye

Member
Licensed User
Longtime User
That´s possible. Yes, dataweedge is the name of the device-config-app. I can´t remember it´s name ;-)

That´s correct. You have to choose what best fit to your needs.

Thanks for the replies @Spavlyuk @DonManfred @teddybear

You configure in DataWedge how a barcode scan is treated. We handle barcodes using broadcast intents with a listener in our apps.

The customer has offered to purchase and send a scanner, but I told him to hold on that until I have some idea of how everything will work. Zebra have been no help because we don't use Android Studio and they are unaware of B4A.

I really hoped somebody on here would have an easy answer, but it seems not.
 
Upvote 0

Heinz

Active Member
Licensed User
Longtime User
i have a NETUM Bluetooth Scanner with usb HID-Keyboard interface. the interface is only
needed for the PC. on my android smartphone i only need an editfield. I connect the
scanner and my phone with BT. The scanner send a RETURN at the end of line. if a barcode
is send to my B4A-App , the EditText1_EnterPressed Event is fired. the only problem is, that
the editfeld must allways the focus. i must this do with my finger manuell to set the focus.
the EditText1.RequestFocus and the IME-Lib have not helped.

I don't know, if this works with a physical keyboard but perhaps you can switch with
installed software.
you also can it try out with a simple editor that has been installed of every smartphone.
 
Upvote 0

Spavlyuk

Active Member
Licensed User
We handle barcodes using broadcast intents with a listener in our apps.
Yes, you can do that with B4A as well. They have some examples in Java that you could fairly easily translate into B4A with the help of JavaObject and Intent.
You already seem familiar with intents so I'm not sure what your specific issue is.

EditText1.RequestFocus and the IME-Lib have not helped.
I've never had an issue with RequestFocus. You just have to make sure you call it after the view is visible, since it doesn't work otherwise.
 
Upvote 0

techgreyeye

Member
Licensed User
Longtime User
Yes, you can do that with B4A as well. They have some examples in Java that you could fairly easily translate into B4A with the help of JavaObject and Intent.
You already seem familiar with intents so I'm not sure what your specific issue is.


I've never had an issue with RequestFocus. You just have to make sure you call it after the view is visible, since it doesn't work otherwise.

I don't have an issue with the scanning. My problem is with the keyboard. I just need to know 2 things.

1) If an EditText has focus, does the text typed on the keyboard go into the EditText
2) If an EditText is not focused, does the typed text fire the Activity KeyPress event (so I can fire other functions like opening menus)

We all seem to think yes, but I wanted someone who knows for sure. I don't want my customer wasting his money :)
 
Upvote 0
Top