This project has moved. For the latest updates, please go here.

Continuously stream QR codes

Jun 18, 2014 at 3:24 PM
Hi, I'm looking for a way to keep the ZXing scanner open when I'm scanning the QR codes inside my android app. I'd like to be able to send the retrieved results back to a file which stores all my data while keeping the scanner open so I can then scan another code and send this back to the same file and so on until the user chooses to stop.
Is there anyway to achieve this?
Coordinator
Jun 19, 2014 at 5:59 PM
It sounds to me that you are using the Xamarin component ZXing.Net.Mobile, right?
If so please open an issue at the project site of the component: https://github.com/Redth/ZXing.Net.Mobile
I can't really help with questions related to that component.
Sep 2, 2014 at 5:14 AM
Hi ab185280,

Were you ever able to solve this problem?

I have the same requirement to keep the scanner/camera screen open.

Any help would be really appreciated.

Kind Regards,
Charan
Sep 2, 2014 at 7:03 AM
Yes I was able to solve it in the end although not via an intent, I had to import the ZXing libraries and edit the source code myself insode the CaptureActivity class.
I changed the HandleDecode method so that it does not show the UI pause inbetween scanning the frames, instead you can place your own code inside the method to do whatever you need. I am writing every successful decode into an arraylist in the decode method then telling the app to go back to scanning for more frames. When the user selects the back button the result containing the arraylist of scanned data is put back to the original native app intent that called it.
public void handleDecode(final Result rawResult, Bitmap barcode, float scaleFactor) {
        inactivityTimer.onActivity();
        lastResult = rawResult;

        try{

                        // your code here
            restartPreviewAfterDelay(BULK_MODE_SCAN_DELAY_MS);
        }
        catch(Exception e){
        }
    }
Hope this helps
Coordinator
Sep 2, 2014 at 7:45 PM
Only one small remark:
Your solution is based on the original java version of zxing and can not be used with ZXing.Net.
Sep 2, 2014 at 8:11 PM
Agreed micjahn.

I'm looking for something in ZXing.net.

Any help would be great.

Thanks guys.

Regards,
Charan