Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8319809
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 8, 20262026-06-08T22:26:16+00:00 2026-06-08T22:26:16+00:00

With the following code the QR Code appears blank in the Blackberry screen, I

  • 0

With the following code the QR Code appears blank in the Blackberry screen, I don’t know what I’m missing. It shows a square centered correctly, but the square itself is white, with no QR code inside.
Any help is appreciated. Thanks.

public QRCodeScreen(String qrCode) {
    this.qrCode = "Test String";
    qrImage = new BitmapField(new Bitmap(QRCODE_WIDTH, QRCODE_WIDTH),FIELD_HCENTER);
    qrImage.setBorder(BorderFactory.createBevelBorder(new XYEdges(2, 2, 2, 2)));

    Hashtable hintMap = new Hashtable();
    hintMap.put(EncodeHintType.ERROR_CORRECTION, ErrorCorrectionLevel.L);
    try {
        MultiFormatWriter barcodeWriter = new MultiFormatWriter();
        ByteMatrix byteMatrix = barcodeWriter.encode(this.qrCode, BarcodeFormat.QR_CODE, QRCODE_WIDTH, QRCODE_WIDTH,hintMap);

        Bitmap bitmap = BarcodeBitmap.createBitmap(byteMatrix, 256);

        qrImage.setBitmap(bitmap);
    }
    catch (Exception e) {

    }

    add(qrImage);
}

}

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-08T22:26:19+00:00Added an answer on June 8, 2026 at 10:26 pm

    Have a look at this sample from the BlackBerry online docs

    If you simply modify it to fit your code above, you get:

    public class QRCodeScreen extends MainScreen {
    
       private String qrCode;
       private static final int QRCODE_WIDTH = 100;
       private BitmapField qrImage;
    
       public QRCodeScreen(String qrCode) { 
          this.qrCode = "Test String"; 
          qrImage = new BitmapField(new Bitmap(QRCODE_WIDTH, QRCODE_WIDTH),FIELD_HCENTER); 
          qrImage.setBorder(BorderFactory.createBevelBorder(new XYEdges(2, 2, 2, 2))); 
    
          try { 
             QRCode code = new QRCode();
             Encoder.encode(qrCode, ErrorCorrectionLevel.L, code);
             ByteMatrix barcode = code.getMatrix();
             Bitmap bitmap = BarcodeBitmap.createBitmap(barcode, QRCODE_WIDTH);
             qrImage.setBitmap(bitmap);         
          } 
          catch (Exception e) { 
             e.printStackTrace();
          } 
    
          add(qrImage); 
       } 
    }
    

    That works for me, on a 6.0 9800 simulator (running your original code produced the blank image as you described).

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

The following code seems not to work, even though the file appears to be
In Android I have the following code to blank an EditText box when clicked.
The following code block runs without error but the 'data' is returned as what
Why do I receive a black screen when using the following code to take
Using Internet Explorer (don't appear to have an issue in FireFox) the following code
Following code produces a nested array as a result for keys containing three items:
Following code takes like 2500 milliseconds on an i7-*3.4 GHz windows-7 64-bit computer to
Following code worked fine abstract class FunctionRunnable<V> implements Runnable { protected abstract V calculate();
Following code: <%= render 'shared/error_messages', f.object %> where f.object is instance of a class
Following code gets executed whenever I want to persist any entity. Things seems to

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.