Object Hyperlinks with QR Code and NFC

Object hyperlinking refers to ways to link physical objects to the digital world. Here, we’ll look at the two prevalent methods for that, QR Codes and NFC tags, and application development using those two technologies.


QR Codes

QR (Quick Response) codes are a general improvement over the standard bar codes we see everywhere on merchandise. While one-dimensional linear bar codes particularly suited for storing serial numbers, they come up short when more data needs to be stored. Hence the advent of two-dimensional (or matrix) bar codes like QR codes that can store information horizontally as well as vertically:

Things are a bit more complicated, as there are different kinds of 1D linear and 2D barcodes, but an in-depth study of those is beyond the scope of this article.  QR codes in particular are faster to read than other 2D barcodes because of their structure, consisting on three corner squares used for position detection. A scanner can use those squares for position and then quickly read the encoded information in all directions from there.

For developing applications using barcodes (whether 1D or 2D),  one option is to use the open-source ZXing (Zebra-Crossing) library, whose focus is on using the built-in camera on mobile phones to read a dozen or so different types of barcodes. For QR code generation, there is the QRGen library which is built on top of ZXing., and makes QR code generations as simple as this:

// Generate a QR code image containing a URL
java.io.ByteArrayOutputStream bout = QRCode.from("https://tsicilian.wordpress.com")
// use standard java I/O to write to a file 
// or a servlet's outputstream to do image generation online

QR codes have existed since the nineties and were initially used for tracking industrial parts . However their use has grown due to the advent of smart phones, since most of those have a camera that can be used by applications to scan the barcodes.  QR codes require nothing but a printer and, apart from the printing costs,  are virtually free. The issues with their use are tied to issue with the camera itself. For example, less than optimal lighting (too dark or too bright) can make the barcode scanning difficult. The smart phone user has also to keep the camera steady.


NFC Tags

Near Field Communication (NFC) is a very short-range (i.e. a few centimeters) wireless technology for transferring data between an NFC-enabled phone and a tag containing a microchip, or with another NFC-enabled phone (P2P beaming).  NFC is slower than Bluetooth, but consumes far less power and sets up faster (doesn’t require pairing). NFC tags are read-write, although they can be locked after a write to prevent any further modifications of the information written.

For development on a variety of hardware, there is the Open Source Open-NFC  project, which supports several types of NFC tags and operating modes.  The core is however written in C, and the Java porting needs to use the provided  JNI interface. As of a pure Java API, Nokia uses the JME Contactless Communication API, RIM handsets have their NFC API in BlackBerry 7, and Android phones have an NFC API since API level 9 and 10.

The advantages of using NFC are quicker reads, larger data capacity, and simplicity of operation: no camera is needed and no specific application needs to be loaded on an NFC-enabled phone, just “tapping” is enough to interact. The disadvantages are that is more expensive (it requires a passive microchip to be embedded in the target) and not easy to print out.



Many see NFC as the Next Big Thing, and making QR codes obsolete.  Google for example, has replaced QR code with NFC on its Android handsets. However, both QR codes and NFC have their pluses and minuses. Although their functionality seem to overlap, they have each their own use cases. QR codes are great in mobile advertising, product tracking,  and location-based applications, where NFC would be overkill. NFC has a wide range of applications, like contact-less payments (as in Google Wallet),  identification and electronic pass, sensor for temperature monitoring in shipping frozen goods,  patient tracking in healthcare, smart posters, etc….


, , , ,

  1. Leave a comment

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )


Connecting to %s

%d bloggers like this: