Using Zxing Barcode Scanner Plus instead of Barcode Scanner or ODK Collect Integrated Scanner for decoding barcodes

Hi fellow ODK'ers

I am using ODK Collect v1.16.0 and XlsForm. I am collecting field data (inc. barcodes) on a Samsung Galaxy J1 mini, (Android 6.0.1) but the rear facing camera has no auto focus and won't scan the barcodes. The front facing camera scans quite well, so I want to use that instead, but Zxing Barcode Scanner (or integrated scanner in versions of ODK Collect after 1.7.0) doesn't allow to toggle between the front and rear camera. Zxing Barcode Scanner Plus allows to toggle between cameras. How do I launch Barcode Scanner Plus from ODK Collect using the ex:* command in Xlsform (i.e. what syntax)? Is there any other way to integrate Barcode Scanner Plus into ODK Collect?

I have successfully managed to get ODK Collect v1.6.0 (pre-integrated scanner) to call Barcode Scanner Plus by default, (i.e. no ex:* command in XlsForm), but any later version of Collect reverts to the integrated scanner by default My preference though is to run a more current version of ODK Collect. Is there any way to do what I am suggesting?

Hi @andhulthen

theoretically you could use ex:com.google.zxing.client.android.SCAN and it opens both Barcode Scanner and Barcode Scanner Plus but unfortunately, you won't receive any value... that's because barcode scanners return values with SCAN_RESULT key but in case of our external widgets, we look for value key.

I'm wondering what we can do for you... maybe we should try to open ex:com.google.zxing.client.android.SCAN in BarcodeScanner and if the app is not installed then use the embedded one. @yanokwa @LN

1 Like

@Grzesiek2010 Or maybe we add an appearance on the barcode widget for front cameras?

1 Like

If it's possible it would be an ideal solution I'll take a look at it.

1 Like

Hi @Grzesiek2010,

From my perspective an appearance on the barcode widget would solve this issue. I see there is recent selfie appearance on the image widget (for front camera) as well…. @yanokwa

@andhulthen we have a pull request at https://github.com/opendatakit/collect/pull/2453 (thanks @Grzesiek2010!) that adds the appearance.

You can track the progress there and I'm hoping we can get it into next month's release.

1 Like

As of ODK Collect v1.17, you can use the front appearance for questions of type barcode.

It still needs to be documented. https://github.com/opendatakit/docs/issues/853 would be a great first documentation issue for someone!

Hi All.
If you are using higher versions of ODK Collect and it has an integrated Barcode scanner as you've stated, would it interfere with the installed Zxing Barcode app?
I'm now unable to scan barcodes using TECNO 10.1 inches, O.S: Android 7.0.

Robert