Image of the glider from the Game of Life by John Conway
Skip to content

QR Code with MECARD and hCard

It's the digital age. Computers are getting cheaper and stronger. Mobile smart phones are becoming a household fixture. Networking is more readily available than ever before and increasing its speed. Yet, many of our daily products remain locked in the past, not taking advantage of what technology has to offer. So, personally, I decided to change the way I at least interact with the digital world, and hopefully, can cause some ripples in the process.

First, I wanted to change my personal "business" card (referred to as a "personal card" from here on out). My initial personal card was an Ubuntu one I had printed after becoming an Ubuntu Member. I ordered 2,500 of them a couple years ago, and I've handed just about every one of them out. Rather than reorder a new batch, I wanted something more generic than just targeting Ubuntu. Further, I wanted to take advantage of technology.

When Google changed their front page logo to a bar code on October 7, 2009 to celebrate the approval of the bar code patent, I spent a great deal of time on Wikipedia learning about bar codes. I knew there was a quite a few out there, but I wasn't aware of all the types, how the encoding was handled, and so forth. In the process, I discovered QR Code.

QR Code appealed to me for a few reasons. First, although a patented technology, it's royalty-free and the patent owner has promised to not exert patent rights on it. This is the same case as with Ogg Vorbis. So, although not truly an "open format" in the pure sense of the word, good enough for me. Further, there is a an application called "qrencode" that is Free Software and available an most GNU/Linux operating systems. So, this makes it easy to create your own QR codes. Second, the technology behind the QR code is rather slick. It contains error correction, should up to 30% of the code be damaged or unreadable. It can be scanned any direction in 360 degrees for bar code scanners. The density is high enough to store up to 7,000 characters. More features can be found on the owner's page.

Immediately, I saw this as an opportunity to encode my contact information. This would be a great way to put your name, web site, email, address, telephone number, and other useful information in a compact space. I could see putting this up on web sites to avoid email harvesters (although it's only a matter of time before they are smart enough to decode QR codes). Then I thought, why not put it on my personal card? The only thing that was preventing me from doing so was an efficient way for a contact who receives my card to get the data out of it.

At the time, the only decoder I was aware of was the ZXING site. You gave it a URL path to a QR code image, or uploaded your own, and it would decode the information. I didn't want people scanning my personal card to an image, then uploading that image to the site. There has to be a better way. So, I started browsing the ZXING site a bit, and I learned that it's an Open Source project for creating a bar code reader. The project is hosted on Google Code, and I found that there is a Blackberry, iPhone and Android app. SWEET!

So, now people can install the free app on their phone, scan the image, and parse out the contact information. The only problem that I saw at the time, is even though they can scan the QR code, and decode the data, the app just presents the user with the raw data, with no ability to add that information to their address book. So, my quest continued. Surely, there must be a way to get the contact information out of the QR code, and into an address book. So, back to web to found out how.

Needless to say, it didn't take long at all before I learned about MECARD. You can think of MECARD as a light version of vCard. Essentially, a single line of text contains all the meta data and appropriate information for populating an address book. Info such as name, address, telephone, email, URL and more. Further, the ZXING app supports parsing MECARD data, and adding that data to your address book!

At this point, I was satisfied. I'm ready to build my own QR code, and put it on my personal card. Well, almost ready. I wanted one extra step before I was ready to commit my personal card to the printer. For the URL in my MECARD, I wanted it to point to additional contact information that could also be parsed using computing for adding to an address book, whether it be on a mobile phone or an email address book, such as in Mozilla Thunderbird or Outlook, or even online, like with Google Contacts. So, I spent more time searching the web, finding a way to get all this integrated.

It wasn't long before I found hCard. hCard is an HTML version of vCard. It's a microformat for embedding HTML into a web site, so applications, just as JavaScript or Firefox extension, can parse the data, and populate an address book with the appropriate entries. The whole point is to keep the contact from entering in the contact information by hand. Otherwise, I just would have printed the raw ASCII on the personal card. No, I want to fully automate my contact information from head to toe taking advantage of mobile phones and other technology. So, hCard fit the bill.

I began populating my own hCard to put on my main site, then the URL in my MECARD would point the user that direction. However, I found that my Google Profile already supports hCard, FOAF, XFN and other standards. So, for me, it made sense to point people that direction rather than build my own. However, after having my QR Code created with everything I wanted, and pointing them to the right URL, and getting the cards printed, I found that Google isn't exporting email address, URL, telephone, or other information that hCard supports in the HTML. I'm a bit disappointed by this, and I wish I would have paid closer attention, but I guess it will have to work for the time being. I'm hoping that Google adds this data to the hCard export, so I don't have to change my personal cards in the near future. :)

Now, the personal cards themselves. I wanted to go hard core, relying 100% on technology to parse the data rather than a human. So, I put just the QR Code on the "front" of the card, with no alphanumeric data anywhere to be found. On the back of the card, I put the glider image, a fanboy icon for the hacker culture and ethic. That's it. An image on one side and an image on the other. The personal card itself has no rotation and should you have a smart phone with a bar code reader, it should be trivial for you to get out the contact information, and populate your address book.

This is a trial run. I don't know what will happen or what will come about as I start handing out this card to people. Time will tell. It should be interesting though, and I'm sure it will be quite the conversation starter. Here's to risks.

{ 13 } Comments

  1. Den using Firefox 3.5.7 on Windows 2000 | January 7, 2010 at 8:08 am | Permalink

    check out this link: http://www.servletsuite.com/mecard.htm

  2. Jonathan Carter using Google Chrome 4.0.291.0 on GNU/Linux | January 7, 2010 at 8:34 am | Permalink

    I think it would be nice if you added a "+" before your phone number, that way people outside of North America can just add it without edits.

    Btw, your QR code has your URL as "htt\://google.com/profiles/aaron.topence"

    Not sure if that backslash instead of a "p" was a typo or something that went wrong with the QR code. Then again it might be something that went wrong with my stupid Nokia E75 :)

  3. Aaron using Firefox 3.5.6 on Ubuntu | January 7, 2010 at 9:40 am | Permalink

    @Jonathan Carter Yeah, I probably should have added the '+1' before the number, but I doubt I'll be visiting any international contacts. However, on the next batch, I'll update that.

    Also, I think something might be wrong with your Nokia. The string, as decoded is:

    "MECARD:N:Toponce,Aaron;TEL:18016868086;EMAIL:aaron.toponce@gmail.com;URL:http\://google.com/profiles/aaron.toponce;;"

    The backslash "http\://" is intentional. ":" is a reserved character in MECARD, so it needs to be escaped for URIs.

  4. ethana2 using Google Chrome 4.0.249.43 on GNU/Linux 64 bits | January 7, 2010 at 11:47 am | Permalink

    Barcode Scanner on Droid says:

    "Found contact info"

    Aaron Toponce
    (phone number)
    (email)
    (web link)

    [Add contact] [Dial number] [Send email]

  5. JGJones using Opera 9.80 on Windows Vista | January 7, 2010 at 2:04 pm | Permalink

    Awesome...tried scanning in your QR code image on my Andriod and it give me the contact details for me. It's a fantastic idea to put it into a business card too. Great idea.

  6. Graham Lyon using Google Chrome 4.0.290.0 on GNU/Linux 64 bits | January 7, 2010 at 3:27 pm | Permalink

    Interesting. Have you thought about the fact that if there's absolutely no alpha-numeric info on the card then they won't be able to tell that the card is yours? I don't know about you, but I have a small collection of cards in my wallet and a friend has an enormous stack on his desk - if they were all qrcodes then I'd have no idea who's was who's without scanning them all (imagine I'm without my mobile or it's flat or died and so I no longer have them all in my address book). If I were to go down the qrcodes path (and I think I might) then I'd definitely have it as a standard business card with the qrcode to the side or on the back or something - if only to ease migration.

  7. Aaron using Debian IceWeasel 3.5.6 on Debian GNU/Linux 64 bits | January 7, 2010 at 4:00 pm | Permalink

    @Graham I don't know about you, but when I get a business card, I put the contact information in my mobile or in Google contacts, then I toss the card. I don't have stacks of business cards. In fact, I don't think I could fine one that isn't mine if I tried. Further, I doubt the one who receives my business card will likely forget me or who I am. Your point is taken though. Although, I don't understand why you would have a stack of QR code business cards, if you've likely already scanned them anyway.

  8. RainCT using Debian IceWeasel 3.5.6 on Debian GNU/Linux 64 bits | January 8, 2010 at 4:42 pm | Permalink

    Awesome! My Nokia 5800 (using "QuickMark") also recognized it perfectly and gave me the option to add it to my contact list, call you, send you a mail or visit the website.

    However, I'm not convinced of the idea of not having anything else other than the image on the card.

  9. Aaron using Firefox 3.5.6 on Windows XP | January 8, 2010 at 6:42 pm | Permalink

    @RainCT yeah, it will be an interesting run. We'll see what happens.

  10. Andy Mabbett using Firefox 3.5.7 on Windows XP | January 9, 2010 at 5:23 am | Permalink

    Neat; but my preference is for a QRCode containing only the URL of a web page, which has the contact details marked up with an hCard microformat and/ or downloadable as a vCard.

    The QRCode is thus smaller; and any future changes to the contact details are instantly available to anyone still holding the business card.

    The web page can also contain additional information, such as "I'm away for two weeks", "For sales enquires, contact..." or "Special offer, this week only...".

  11. gcbound using Firefox 3.6.3 on Windows XP | May 29, 2010 at 3:39 pm | Permalink

    When I use a Google Chart API call like this:

    http://chart.apis.google.com/chart?cht=qr&choe=UTF-8&chs=400x400&chl=MECARD%3AN%3AJohn%20Doe%3BTEL%3A%28123%29%20456-7890%3BEMAIL%3AJohn.Doe%40doe.com%3BADR%3A123%20N.%20JD%20St.%2CDoe%20City%2CHawaii%2C12345%2CUnited%20States%3BURL%3Ahttp%5C%3A%2F%2Fjohndoe.com%2Findex.php%3B%3B

    and scan the resulting QR code, Barcode Scanner on the Droid shows the URL and it's a link I can actually click on. But I thought that URL would be included as the Gmail Contact "website" field and it isn't.

    Wondering why that doesn't work...

  12. Ed Urbaniak using Google Chrome 8.0.552.237 on Windows 7 | February 5, 2011 at 6:07 pm | Permalink

    I am totally with you on making this automatic. The hcard (as far as I can tell) doesn't populate a card or even give you the option to add a new contact. The MECARD seems the way to go, but some many issues.

    1) Name field (N) populated only the first name on andriod (user intervention
    2) MECARD doesn't appear to allow for phone types (mobile, home, work, fax)
    3) The address all populates the address field and not the city, state and zip.
    4) URL doesn't seem to be recognized.

  13. Aaron using Google Chrome 9.0.597.83 on GNU/Linux 64 bits | February 6, 2011 at 7:52 am | Permalink

    What issues?

    1) The name field is limited only to what you provide it with. If you scan my card (with a barcode reader that has full MECARD support), the full name, separated by the last and first even, is available.
    2) Yes. This is a limitation. However, it does support multiple TEL numbers.
    3) The address can be parsed by address field, city, state, zip, etc. The fields divided by commas (,) denote PO box, room number, house number, city, prefecture, zip code and country, in order.
    4) I don't know what your problem is with the URL, but it scans fine here, and clicking the link pulls up the page.

{ 1 } Trackback

  1. [...] anyone can generate and use QR codes without fear of royalty payments, licensing restrictions, etc. I even made my own business cards out of QR Codes. Anyway, today I saw the Three Laws of Robotics in QR codes on the door frame of my physics [...]

Post a Comment

Your email is never published nor shared.

Switch to our mobile site