Android Question Android Box Tv and USB Scanner

EduardoElias

Well-Known Member
Licensed User
Longtime User
I need to use a table scanner (those like boxes), used in supermarkets, connected via USB to a Android Box TV

It sends the data as a keyboard simulator

I will write a small app to read from this scanner and send it thru the network.

However I need to be certain that it will always get the data.

What could be the right way to do so?
 
Last edited:

EduardoElias

Well-Known Member
Licensed User
Longtime User
maybe I was not clear enough, the USB connection is fine, it works like a keyboard for he Box.

However I need to get that typing, what I can do using a EditText, however I experimented before that focus control is somewhat strange, and things like an <enter> could open the app drawer menu for exemple.

I wonder if there is a different approach to catch the keyboard
 
Upvote 0

EduardoElias

Well-Known Member
Licensed User
Longtime User
Try disable key press for the app drawer button or prevent it has focus.
How to do that? never found a way to impede that the focus move to the drawer....

I have this problem in another app that I use the <enter> key as a way to remove cards from the screen. In some Android Boxs it leads to focus the drawer (the 3 dots on the top right) and open it.

But in some other boxes it just work as expected.

I am intercepting using the Activity_KeyPress and returning true consuming the event.

I could use Activity_KeyPress to get the events for the data from the barcode instead of a edittext, not sure what is best
 
Upvote 0

aeric

Expert
Licensed User
Longtime User
What you mentioned won't help you get any answer. You are giving a very vague information. There are too much possibilities and factors causing the problem.

Can you be more specific? What are the TV box models you are using and the Android versions, which work, which does not. What model of USB scanner?
Maybe someone else having the same model and can test for you.

Can you provide the link of the tutorial for the navigation drawer where you copy the code from?
Upload a small project and show what you have done.
 
Upvote 0
Cookies are required to use this site. You must accept them to continue using the site. Learn more…