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

New Contributor
Posts: 3
Registered: ‎12-02-2010
My Device: Not Specified

Re: barcode example not working

I am able using Torch simulator to test barcode examples. I am able to scan QR-codes, but unable to scan EAN-13 barcode. The lines are visible clearly. And I used the example EAN-13 barcode image of Wikipedia for testing. What may be the problem? Please help me to find the problem.





New Contributor
Posts: 3
Registered: ‎12-02-2010
My Device: Not Specified

Re: barcode example not working

Good morning,

I found the reason for my problem. The barcode api example app is working for EAN-13 when ever I tested the application in the device. So try to check the app in the device if you are unable to get the correct result in the simulator.





Posts: 16
Registered: ‎04-08-2011
My Device: Torch 9800
My Carrier: Vodaphone

Re: barcode example not working

Late post but hopefully it helps future developers:


You will need to modify the code because the "display" and "scan" buttons for the Torch are "touch screen" buttons.

Since the Bold's screen is just a screen, the display and scan buttons need to be converted into buttonfields, here's an example:


_mainScreen.setTitle("Barcode Scanner");

ButtonField scanButton = new ButtonField("Scan Barcode", ButtonField.CONSUME_CLICK | ButtonField.NEVER_DIRTY |


scanButton.setCommand(new Command(new CommandHandler() {

public void execute(ReadOnlyCommandMetadata arg0, Object arg1) {






Hope that helps,




New Contributor
Posts: 5
Registered: ‎05-04-2011
My Device: 9800
My Carrier: Telcel

Re: barcode example not working

I had problems too with the BarcodeScanDemo in the JDK 6.0... it worked fine in the simulator, but didn't work on a real Torch device.


But when I tried BarcodeAPISample in http://supportforums.blackberry.com/t5/Java-Development/How-to-use-the-Barcode-API/ta-p/574569  it worked fine in a Torch device and in the simulator.


(I only tested QR code scanning)

Posts: 1
Registered: ‎02-28-2012
My Device: 9300
My Carrier: airtel

Re: barcode example not working


      I tried to run qrcode scan application on blackberry curve os6 using blackberry api but its not working .

it is working fine for tourch. but i have to work on blackberry curve. i also want to know that  for scanning qr/bar code should device has autofocus camera?