Welcome to the official BlackBerry Support Community Forums.

This is your resource to discuss support topics with your peers, and learn from each other.

inside custom component

Java Development

Regular Contributor
Posts: 97
Registered: ‎04-19-2012
My Device: BB Torch-9800
My Carrier: *

Problem with QR Code generation in Blackberry OS.5.0?

Hi All,


I am using below code for genrating a bar code using com.google.zxing library in BB OS.5 but getting error

"Array Index out of bound index 21>= 21." Problem with BarcodeBitmap.createBitmap function cause I am using


Please help me to solve out the problem.

ry {
            QRCode qrCode = new QRCode();
            Encoder.encode("text", ErrorCorrectionLevel.L, qrCode);
            // From there we get the actual data matrix and convert it into a
            // bitmap
            ByteMatrix barcode = qrCode.getMatrix();
            Bitmap bitmap = BarcodeBitmap.createBitmap(barcode, BARCODE_WIDTH);


        } catch (Exception e) {
            Util.errorDialog("error encode: " + e.getMessage());