Welcome!

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

Reply
Trusted Contributor
user17
Posts: 145
Registered: ‎01-23-2012
My Device: 9300
Accepted Solution

barcode code scanning

[ Edited ]

Hi ,

 

         I want to develop qr code and barcode scanning in blackbery.

please help me if any one worked on this.

 

 

thanks

Developer
KushBB
Posts: 374
Registered: ‎04-07-2010
My Device: Bold 9000

Re: barcode code scanning

Code? No one is going to feed you the code that easily, Search, Try and Develop.

Anyways, here's well known library that can help you to do it: 

 

http://code.google.com/p/zxing/

Press the Like button (Thumb up) on the left side to thank and
please mark the Thread as solved if its solved...
K.S
Developer
alishaik786
Posts: 285
Registered: ‎08-26-2011
My Device: 9900

Re: barcode code scanning

From version 6.0 onwards import the sample demo "BarcodeScanDemo" from the blackberry samples and do your own QR-CODE Scan and Image generation etc. 

 

The Blackberry provides how to scan QR-CODE only; You should have to get the idea of that sample applcation then you can create your own Barcode Demo;

 

We can create 

1. We can Decode Any type of Barcode Scanning Application(Under Blackberry provided Formats)

2. Generate the QR-Code Image and show the image(nothing but we store in "bitmap");

3. We can Decode Any type of Barcode Images(What Blackberry Provide Formats) without Scanning.

 

Generating and scanning is very easy when you run the sample demo in the device not on simulator. 

=================================================================================

Feel free to click LIKE button if the answer is helped to you;

=================================================================================
Feel free to click LIKE button if the solution helps you;
--
Regards,

ALI SHAIK.
Trusted Contributor
user17
Posts: 145
Registered: ‎01-23-2012
My Device: 9300

Re: barcode code scanning

[ Edited ]

 

Thank you  Ali Shaik for your reply.

Iam using blackberry o.s version 5. Is their any sample demo for version 5.

i have to scan the barcode format (it may be qr code, code 128, and code39 etc ) using blackberry application.

with out knowing the barcode format  is it possible to scan.

 

Please help me.

Developer
alishaik786
Posts: 285
Registered: ‎08-26-2011
My Device: 9900

Re: barcode code scanning

[ Edited ]

If you want to do in 5.0 ,

 

1. Download the ZXing-1.7.zip or ZXing-2.0.zip  from this below link:smileysad:Better to take 1.7 older one:smileywink:

 

ZXing for Blackberry Barcode Application;

 

2.  Extract the Zip file and take the "com" forlder in the below path from extraced file

 

ZXing-1.7\zxing\core\src\

 

and paste it into your your Application's src folder;

 

3. Then Extract UsingBarcodeLib file and take the org folder and put it into your src folder from the following path:

 

"\ZXing-1.7\UsingBarcodeLib\src" 


4. And take the sample BarcodeScanDemo.java only from 6.0 add to your own package; and try to run it;

 

============================================================================

Feel free to click the LIKE button if the solution helps you;

 

=================================================================================
Feel free to click LIKE button if the solution helps you;
--
Regards,

ALI SHAIK.
Trusted Contributor
user17
Posts: 145
Registered: ‎01-23-2012
My Device: 9300

Re: barcode code scanning

 

Thank you ALI SHAIK.

 

I will try this code. Is it possible to scan any format of barcode with out selecting the barcode format(like code 128,qr code etc)

Developer
alishaik786
Posts: 285
Registered: ‎08-26-2011
My Device: 9900

Re: barcode code scanning

He provide only for QRCODE; 

 

you can add all the formats: Replace here:

 

 Hashtable hints = new Hashtable();
 Vector formats  = new Vector(1);
 formats.addElement(BarcodeFormat.QR_CODE);
 hints.put(DecodeHintType.POSSIBLE_FORMATS, formats);

 

 as:

 

Hashtable hashtable=new Hashtable();		
Vector formats=new Vector(10);
formats.addElement(BarcodeFormat.QR_CODE);
formats.addElement(BarcodeFormat.PDF_417);
formats.addElement(BarcodeFormat.CODE_128);
formats.addElement(BarcodeFormat.CODE_39);
formats.addElement(BarcodeFormat.DATA_MATRIX);
hashtable.put(DecodeHintType.POSSIBLE_FORMATS, formats);

 like this you can add all the Blackberry barcode formats provided by blackberry; and run the application;

========================================================================

Feel free to click LIKE button if the answer is helped you;

=================================================================================
Feel free to click LIKE button if the solution helps you;
--
Regards,

ALI SHAIK.
Regular Contributor
tububerry
Posts: 51
Registered: ‎05-25-2012
My Device: Bold 9930

Re: barcode code scanning

[ Edited ]

Hi,

 

Just an Info: 

 

while generation of Barcode  other than QR, the size of the data must match the requirements.

 

 

BarcodeFormat format = BarcodeFormat.EAN_13 // gives exception Requested contents should be 11 or 12 digits long, but got 4: -1

 

the content(data) must be 11 or 12 digits