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
jameztcc
Posts: 49
Registered: ‎11-11-2012
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.
Please use plain text.
Developer
zezke
Posts: 1,004
Registered: ‎12-12-2010
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!
Please use plain text.
Developer
Curahee
Posts: 206
Registered: ‎01-12-2013
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/

______________________________________________________
beRail: BlackBerry World - GitHub
Mobile Vikings: BlackBerry World - GitHub
Park in Brussels: BlackBerry World
Please use plain text.
Contributor
nhuanvd
Posts: 19
Registered: ‎12-11-2012
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

 

Please use plain text.
Developer
jameztcc
Posts: 49
Registered: ‎11-11-2012
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.
Please use plain text.
Developer
BBSJdev
Posts: 4,906
Registered: ‎07-05-2012
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. :smileyhappy:

Developer of stokLocker, Sympatico and Super Sentences.
Please use plain text.