Skip to content Skip to sidebar Skip to footer

Qr Code Generated By Android Zxing Library Doesn't Scan With Most Qr Code Scanners

I am posting this to answer my own question (to spread the word in case anyone else has had this issue.) I am generating a QR code using ZXing's Android library. The QR code gener

Solution 1:

The answer to this issue:

The QR code is actually flipped. Although the ZXing documentation does not explain how to index into the array that qrCode.getMatrix().getArray() returns, it assumes that you will index it as [y][x], and then draw that cell at (x,y). The code posted in the question indexes the array as [x][y], which flips the image along the Y=X line.

The resulting QR code seems legitimate, but only 'smart' scanners can detect this sort of flipping and scan it.

The error correction level bits are also on the opposite corner, so if you were to verify by hand (looking at a few bits in the lower right corner of the image), it would appear that the library is ignoring the error correction settings.

flipped QR code

Solution 2:

Not necessarily the answer to your question, but you can consider Google's QR generator. I used it and it pretty simple. Google QR

Post a Comment for "Qr Code Generated By Android Zxing Library Doesn't Scan With Most Qr Code Scanners"