Posts tagged ‘QRCode’
iPhone QRCode Integration
For one of my jobs I had to integrate QRCodes into the app. A QRCode is a 2 dimensional barcode, like you see here:

There are several ways of generating QRCodes online, including this one for generating MeCards, and this one for generating text, URL, SMS, and phone number ones.
Integrating QRCodes into an iPhone app is pretty easy, because there’s already an open source project that does it. It’s called ZXing (or Zebra Crossing).. It’s cross platform and includes Android and other versions too. We just need to concern ourselves with the iPhone version.
Included in the project is a bunch of actions too, depending on what is encoded in the QRCode. It’ll attempt to parse the code and generate an email address or a MeCard or one of several others things as well. All the action happens in the DecoderViewController class, and presentResultForString is the method you want to look at to see what it does with the results of the image scan.
You can actually use your iPhone to take snapshots of QRCodes right from your computer’s monitor. I’ve used this method to test my app, but frankly it’s not always reliable. As well, it works a lot better with the 3GS camera than the 3G camera, because it’s just better.