Search code examples
androidqr-codezxing

how to convert a very large string to QR code?


I am going to write a program to convert a Json String to QR Code using Zxing library but my Json is too long sometimes , so what is the best approach to handle long Json string to make Qr Code?


Solution

  • One QR code can contain up to 4296 aplpha-numerical characters with the lowest error correction level. If your json is larger you can try some kind of compression algorithm. But there is no standard definition for data compression inside of qr codes. So normally no barcode scanner can uncompress your data. Another feature of QR codes is structured append which means that you can split your data across separate QR codes. But it is similar to compression, it is not guaranteed that every barcode scanner supports structured append. So it is better not to store large amounts of data inside the QR code. Perhaps you can find a way to store the data elsewhere and only encode an URL inside the QR code which points to the data (like mentioned by mastermind).