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

Native Development

Reply
Developer
Posts: 49
Registered: ‎11-11-2012
My Device: z10 LE
My Carrier: Digi
Accepted Solution

Encode / generate QRCode/barcode

Hi,

 

any starting point how I could encode/generate a qrcode as an image to display in QML?

 

thanks!



James Tan
Eating my dog food - TripLogger, my 1st bb10 app.
Developer
Posts: 1,008
Registered: ‎12-12-2010
My Device: Passport (Red Limited Edition)
My Carrier: Mobile Vikings

Re: Encode / generate QRCode/barcode

There must be some C++ libraries out there, alas I don't know them. The other option is to use an online API (like https://www.mashape.com/cingusoft/barcode-generator-2-0 etc).
-------------------------------------------
BlackBerry Certified Builder for Native Application Development -- Proud member of the Belgian BlackBerry Developer group
Samples: Park in Ghent
Feeling generous? Nominate me for BB Elite member!
Developer
Posts: 230
Registered: ‎01-12-2013
My Device: z30
My Carrier: Mobile Vikings

Re: Encode / generate QRCode/barcode

You can have a look at Zxing. They have developed a QR generator/decoder for Java but they also created a partial C++ port. Maybe it helps you a little.

 

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

______________________________________________________
BB10-OAuth: GitHub
Developer
Posts: 27
Registered: ‎12-11-2012
My Device: Blackberry Z10
My Carrier: Viettel

Re: Encode / generate QRCode/barcode

Have you solved your problem? This is a easy way to show QrCode.

 

QrCodeView {
	id: qrCode
	data: "Your Data Here"
	preferredWidth: 300
	preferredHeight: 300
	horizontalAlignment: HorizontalAlignment.Center
}   

 You need to import

import bb.cascades.multimedia 1.0
import bb.multimedia 1.0

 and add the following line to your .pro file:

LIBS += -lbbcascadesmultimedia

 http://developer.blackberry.com/cascades/reference/bb__cascades__multimedia__qrcodeview.html

 

Developer
Posts: 49
Registered: ‎11-11-2012
My Device: z10 LE
My Carrier: Digi

Re: Encode / generate QRCode/barcode

I've tried using c++ libraries but am not skilled enough to take it off.

Used the online API approach e.g. http://api.qrserver.com and it works though webview is unpredictable at times.

The official QrCodeView works without network connectivity and suits my purpose.

Thanks everyone for the ideas!


James Tan
Eating my dog food - TripLogger, my 1st bb10 app.
Developer
Posts: 6,152
Registered: ‎07-05-2012
My Device: Playbook, Dev Alpha C, Z10 LE, Z30
My Carrier: Orange

Re: Encode / generate QRCode/barcode

I'm surprised no-one mentioned there is actually a BarCodeViewer as well as other associated classes for Cascades itself...

 

http://developer.blackberry.com/native/reference/cascades/bb__cascades__multimedia__barcodeview.html

http://developer.blackberry.com/native/reference/cascades/bb__cascades__multimedia__barcodegenerator...

 

Does need 10.2 though.


If you've been helped click on Like Button, if you've been saved buy the app. Smiley Happy

Developer of stokLocker, Sympatico and Super Sentences.
New Developer
Posts: 3
Registered: ‎06-10-2014
My Device: non-BlackBerry user
My Carrier: non-BlackBerry user

Re: Encode / generate QRCode/barcode

have you ever done this , java qr code generation