Skip to content

Barcode doesn't provide rawData as a byte array!~ #156

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
815vojta opened this issue Nov 25, 2016 · 12 comments
Open

Barcode doesn't provide rawData as a byte array!~ #156

815vojta opened this issue Nov 25, 2016 · 12 comments
Labels

Comments

@815vojta
Copy link

I use com.google.android.gms.vision.barcode.BarcodeDetector in order to read QR codes. The problem is these codes carry raw binary data; no phone numbers, no URLs, no geopoints... I cannot change these QR codes, because they are generated in a different application.

When I scan these QR codes using Android Barcode API, the resulting Barcode object doesn't allow me to access the raw data, although it must know it!

All I get is "Unknown encoding" message both in rawValue and displayValue properties.

Having a byte[] property instead of two String properties would make more sense, since QR codes can carry general data.

I don't see the point of hiding raw data byte array from developers. Could I somehow extend the BarcodeDetector class or the Barcode class to get what I need?

Thanks a lot!

Related Stack Overflow question

@blindgaenger
Copy link

Yep, I've got a similar use-case with custom aztec codes. Like @815vojta said it would be helpful to provide the raw bytes instead of an error message.

@pchx-zz
Copy link

pchx-zz commented Nov 30, 2016

Thanks for the feedback.

Unfortunately, there is no way to obtain the raw bytes without adding a new byte[] field since Java requires that Strings contain valid UTF-16. Right now your best option, if you control both the sender and receiver, is to encode your data in a supported character set (e.g. ISO-8859-1).

@815vojta
Copy link
Author

815vojta commented Nov 30, 2016 via email

@815vojta
Copy link
Author

Is there any progress on this topic? Why couldn't you just add a new byte[] field?

Could you please have a look why this code cannot be decoded?

http://stackoverflow.com/questions/40789386/android-vision-barcode-api-read-custom-qr-code-with-binary-data

@bsoja
Copy link

bsoja commented May 24, 2017

+1

3 similar comments
@Wayn0
Copy link

Wayn0 commented Jun 19, 2017

+1

@kazougaghwaltz
Copy link

+1

@kotlindroider
Copy link

+1

@kazougaghwaltz
Copy link

+1

1 similar comment
@Ke4nuReeves
Copy link

+1

@rchinoy
Copy link

rchinoy commented Sep 13, 2019

+1

This is a rather large limitation that needs to be addressed.

@mfranzke
Copy link

mfranzke commented Nov 7, 2019

+1

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

10 participants