ErrorCorrectionLevel

enum ErrorCorrectionLevel : Enum<ErrorCorrectionLevel>

The level of Error Correction to apply to the QR Code image. The Higher the Error Correction, the lower quality print the QRCode can be (think of "wow, even with the paper a bit crumpled, it still read the QR Code!" - that is likely a Q or H error correction).

The trade-off is the amount of data you can encode. The higher the error correction level, the less amount of data you'll be able to encode.

Please consult Kazuhiko's Online Demo where at the time of writing a handy table showed how many bytes can be encoded given a data type (QRCodeDataType) and Error Correction Level.

This library automatically tries to fit ~2048 bytes into the QR Code regardless of error correction level. That is the reason and meaning of maxTypeNum.

Rewritten in Kotlin from the original (GitHub)

Author

Rafael Lins - g0dkar

Kazuhiko Arase - kazuhikoarase

Parameters

value

Value associated with this error correction level

maxTypeNum

Maximum type value which can fit 2048 bytes. Used to automatically calculate the type value.

Entries

Link copied to clipboard
H(2, 34)
Link copied to clipboard
Q(3, 30)
Link copied to clipboard
M(0, 25)
Link copied to clipboard
L(1, 21)

Properties

Link copied to clipboard
val maxTypeNum: Int
Link copied to clipboard
val name: String
Link copied to clipboard
val ordinal: Int
Link copied to clipboard
val value: Int