开发者

Have a barcode scanner called instead of the keyboard in a webview

Is it possible to have the barcode scanner (zxing for example) called instead of the keyboard in a webview? So, just to be clear, when I tap in a text box inside my webview I'd like to override the keyboard call and have the barc开发者_运维知识库ode scanner open instead as an input to the text field. Is this feasible?


Yes its possible , i implemented this softkeyboard which does the job. 'Long press' shift key and you can scan a code which adds to the text field which has focus.

http://www.androidbroadcast.com/en/softkeyboard/index.html


Barcodescanner Keyboard lets you do exactly this. It is definitely possible.


it possible go to http://www.tec-it.com/en/software/android/barcode-keyboard/barcodekeyboard-overview/Default.aspx download barcode keyboard demo version and enjoy....


Not in any kind of standard fashion: you could plug a custom JavaScript handler that listened for focus messages from the specific text input (identified perhaps by id?) and then use the InputMethodManager to hide the input method and launch your barcode reader. When the barcode reader returns with content you could then use the same JavaScript handler to insert the result into the text input field.


This isn't exactly what you are asking for but might work: You could modify the ZXing bar code scanning library to dispatch key events for each character in the scanned bar code. I assume these key events would be interpreted by the text field. You can program the bar code scanner to append a carriage return or whatever to accept the data into the text field as if someone had hit the enter key. You could put a border around your layout and turn it red or something to indicate to the user that it will accept typed in data or a bar code scan.


It is not possible -- at least, there's nothing in Android or ZXing that lets you do this directly. But you can certainly write your own Input Method that does such a thing, if you're willing to put in the work. ZXing is open source and there have been some topics about it in the discussion group.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜