Android Vision Barcode API - read custom QR code with binary data
<p>I use <code>com.google.android.gms.vision.barcode.BarcodeDetector</code> 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.</p>

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

<p>All I get is <code>"Unknown encoding"</code> message both in <code>rawValue</code> and <code>displayValue</code> properties.</p>

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

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

<p><strong>Edit:</strong></p>

<p>This is an absolutely valid QR code, which cannot be read by Vision API, although it carries 1024 bytes of data:</p>

<p><a href="https://i.stack.imgur.com/9Ob3t.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/9Ob3t.png" alt="enter image description here"></a></p>

<hr>

<p><a href="https://stackoverflow.com/questions/38398840/qr-codes-raw-binary-data">QR Codes - raw binary data</a> is related, but it doesn't solve my problem.</p>