wewewe718 / QrAndBarcodeScanner

An Android app for scanning QR codes and barcodes
The Unlicense
745 stars 143 forks source link

Support zxing URI scheme [feature request] #148

Open dlenski opened 2 years ago

dlenski commented 2 years ago

The no-longer-maintained ZXing Barcode Scanner app (com.google.zxing.client.android) supports a URI scheme that allows web apps to scan barcodes and retrieve the results…

As documented at https://github.com/zxing/zxing/wiki/Scanning-From-Web-Pages, these URIs look like the following:

Basically, when one of these links is opened, an Android mobile browser will redirect to the app, scan a barcode, and then redirect back to the return UI specified, filling in query parameters like {RAWCODE} (the raw text of the barcoe) and {FORMAT} (e.g. QR).

I have used this facility in a couple of web apps I've written myself. (I'm also a contributor to the core ZXing library, and the maintainer of a Python wrapper for it.)


tl;dr It would be really great if this much more modern barcode scanning app would handle the ZXing URI schemes, since this would allow web apps that rely on this mechanism to continue working.

dlenski commented 2 years ago

Here are where the intent filters for the ZXing URI schemes are defined in the ZXing Barcode Scanner app: https://github.com/zxing/zxing/blob/master/android/AndroidManifest.xml#L61-L88

And most of the implementation is in…