Right...
Some time ago I helped another developer on the list with a similar situation.
The guy's name is Guy Ronen.
To my greatest shame I could not find the code I sent to him.
Dig a bit through the discussion group's archive.
Mainly you will need to subclass WebViewClient, and handle manually
the requests to open the ZXing Bar-Code scanner.
I will try to be more helpful by looking for the actual code...
2012/7/27 Gabriel <
gabriel....@googlemail.com>:
> I'm trying to develop webview app which need to scan barcode. I use
> IntentIntegrator and following code in JavaScriptInterface:
> protected void onActivityResult(int requestCode, int resultCode, Intent
> data)
> {
> switch(requestCode)
> {
> case IntentIntegrator.REQUEST_CODE:
> {
> if (resultCode != Activity.RESULT_CANCELED)
> {
> IntentResult scanResult =
> IntentIntegrator.parseActivityResult(requestCode, resultCode, data);
> if (scanResult != null)
> {
> barcode = scanResult.getContents();
> showToast(barcode);
> }
> }
> break;
> }
> }
> }
>
>
>
> On my website I have following code:
>
> <script type="text/javascript">
> var count = 0;
> function scan() {
> Android.scanBarcode();
> }
>
> var count = 0;
> var handle;
>
> function checkBarcode() {
>
> if (count < 0) {
> window.clearInterval(handle);
> return;
> }
> debug.innerHTML = "check... " + count;
> var s = Android.getBarcode();
> if (s != "") {
> debug.innerHTML = s;
> Android.clearBarcode();
> }
> }
>
> function ScanBarcode() {
> count = 10;
> scan();
> handle = window.setInterval("checkBarcode()", 500);
> }
> </script>
>
>
> but after returning from camera view I see in debug only "check... 10" and
> nothing more. How can I get the scanned characters?
>
>
> Regards, Gabriel
>
> --
>
>
>