I have an Activity
where the user can read some barcodes with a barcode scanner (think on it like a hardware keyboard), which sends a string (usually full of numbers) and a CR symbol at the end (an "enter", we could say). When I read this CR symbol, I have to open a dialog
and do some stuff on it with the received string.
The questions are:
- How can I listen the string received form the barcode scanner without writing it on an
EditText
? I mean, since the barcode scanner is like a hardware keyboard, writing the string on a hiddenEditText
and then listen for the CR symbol could be a solution, but there has to be a more elegant way... - How can I listen to the CR symbol and how could I difference it from the string full of numbers?
I've taken a look at the Handling Keyboard Actions tutorial, but I think it doesn't fit my needs.
Any idea?