Tag Archives: qr

How to Generate a URL containing QR code using Google Charts API CodeUnit 18 MAY 2011

QR codes are slowly, slowly gaining more traction, despite the fact that they are pretty much only useful little beasts when it comes to directing smartphone users to some or other web content URL. Generating them is pretty easy, hell, Google Chart has an API for them (which is exactly what we are going to leverage in a minute), and to decode them you simply need a phone with a camera and a decoder app installed. So let’s do this.

If you are already familiar with using the classic Google Chart API to generate graphs, then you will know that creating a graph image is pretty much hitting a Google-supplied URL and providing certain required paramters as specified by the Chart API. Because QR codes essentially work the same way as graphs do, i.e. they are produced based on the passed information, it was a fairly simple task to incorporate them into the API. One or two minor parameters added and removed (as laid out by http://code.google.com/apis/chart/docs/gallery/qr_codes.html) and you’re good to go.

To actually see this in action, let’s generate a QR code which is nothing more than an encoded URL (if hit by a smartphone, the phone should attempt to redirect to the encoded URL):

<img src=”http://chart.apis.google.com/chart?cht=qr&chs=350×350&chl=http%3A%2F%2Fwww.codeunit.co.za” />

As you can see above, only three parameters are required to generate our desired QR code. cht is to tell Google that it is a QR code, chs defines the size and chl contains the data to be encoded, in this case a URL. Note that the data needs to be URL encoded before being passed to the API.

And the result?

Nifty.

BlackBerry QR Code Reader CodeUnit 27 APR 2011

QR Codes are useful ways to visually encode data like URLs or Contact Details or just about any string you want to in a nice black and white square diagram. To read them, you basically just need to take a picture of them and then let a QR Code Reader handle the rest. So what is the easiest way to read QR codes on your BlackBerry?

Well the easiest way turns out to be the standard BlackBerry IM workhorse of choice for most people, BlackBerry Messenger or BBM if you prefer the acronym.

Simply open BBM and then select “Scan a Group Barcode”. The camera will open and once you have the desired QR code in focus, the system will prompt you that it has picked up a QR code and will want to know what to do next – like browse to the URL for example!

Simple and nifty.

Online QR Code Decoder CodeUnit 22 APR 2011

QR codes are slowly, slowly gaining more traction, despite the fact that they are pretty much only useful little beasts when it comes to directing smartphone users to some or other web content URL. Generating them is pretty easy, hell, even Google Chart has an api for them, and to decode them you simply need a phone with a camera and a decoder app installed. But what if you don’t have a phone for testing and simply want to check that your generated QR code is correct?

Well for that you need a desktop decoder, or in our case an online decoder. Enter the poorly named ZXing project (Apparently this stands for Zebra Crossing), which is dedicated to producing a multi-format 1D/2D barcode image processing library, implemented in Java.

Anyway, they have released a very handy online decoder that allows you to either submit an URL or upload an image containing a valid QR code, which it will then decode and return its encoded contents for.

Very, very nifty.

The decoder can be found at: http://zxing.org/w/decode.jspx

Online QR Code Encoder (Generator) CodeUnit 20 APR 2011

QR codes are slowly, slowly gaining more traction, despite the fact that they are pretty much only useful little beasts when it comes to directing smartphone users to some or other web content URL. Generating them is pretty easy, hell, even Google Chart has an api for them, and to decode them you simply need a phone with a camera and a decoder app installed. But if you aren’t particularly computer illiterate, what is the best way to generate a QR code of your own?

Well for that you need an online encoder (or generator if you like). Enter the poorly named ZXing project (Apparently this stands for Zebra Crossing), which is dedicated to producing a multi-format 1D/2D barcode image processing library, implemented in Java.

Using the previously mentioned Google Chart API, they have released a very handy online QR code generator that allows you to enter the various bits of information you wish to encode and then spits out the generated QR code image which you can download and do whatever you want with.

Very, very nifty.

The encoder can be found at: http://zxing.appspot.com/generator/