Saturday, May 17, 2008

Google QR encoder - the hidden functionality

I was bored today, so by trial and error I put together the following documentation located at http://www.cognation.net/qr/google_api.htm for hidden 2D encoding functionality of the Google QR Chart api. Feel free to post if you have any suggestions/alternative functionality I missed.

Cheers,
Dean


Google QR encoder API
The Google QR encoder API located here http://code.google.com/apis/chart has been out for a few weeks now, I originally posted about it here http://deancollinsblog.blogspot.com/2008/05/google-chart-api-now-generates-qr-codes.html

The chart API is a fantastic application where any browser will return an image dependant on the url entered, originally designed for charts/graphs etc but in this instance you can enable the return of a 2D barcode in the form of a QR image.

btw in case you are wondering - I use a Cingular 8525 (otherwise known as the HTC Tytyn) - and my QR
reader of choice is the Quickmark reader - available for free download at http://www.quickmark.com.tw/

I kept waiting for Google to provide some documentation ( which they haven't for whatever reasons :) or extend the capability as until then it’s really just a neat trick.

So I was sitting around today looking for a project to do....... through trial and error let me provide you some
documentation about the hidden extended functionality available on the Google QR Encoder API.


URL is the 'documented function'
http://chart.googleapis.com/chart?cht=qr&chs=200x200&chl=http://www.cognation.net/profile















Send Email
http://chart.googleapis.com/chart?cht=qr&chs=200x200&chl=dean@cognation.net













XXXX Send Email with subject ?? cant seem to get this to work but seems like it should so feel free to post if you work out how to do it.
http://chart.googleapis.com/chart?cht=qr&chs=200x200&chl=dean@cognation.net:subject:












Dial From QR
http://chart.googleapis.com/chart?cht=qr&chs=200x200&chl=tel:19172073420












Dial from QR 2 or more numbers separated by a "comma , " (comma cant do 2 sms though)
http://chart.googleapis.com/chart?cht=qr&chs=200x200&chl=tel:19172073420,12122034357,1917456321 













SMS to number
http://chart.googleapis.com/chart?cht=qr&chs=200x200&chl=sms:19172073420
SMS to number with message
http://chart.googleapis.com/chart?cht=qr&chs=200x200&chl=sms:19172073420:Message















MeCard functionality - this is the area I think the Google API really lets you down. Vcard is far more effective/useful and has more 'spaces' for information. Google have also left out certain fields for the MeCard standard.

(if you want to see the differences between MeCard and Vcard check out the samples on the Quickmark encoding site)

http://chart.googleapis.com/chart?cht=qr&chs=200x200&chl=MECARD:N:Dean,Collins;ADR:smith%20st,new%20york;TEL:9172073420;EMAIL:dean@Cognation.net;URL:www.cognation.net;NOTE:this%20is%20a%20test












http://chart.googleapis.com/chart?cht=qr&chs=200x200&chl=MECARD:N:Dean,Collins;ADR:smith%20st,new%20york;TEL:9172073420;EMAIL:dean@Cognation.net;URL:www.cognation.net;NOTE:this%20is%20a%20test
















You can have 2 phone numbers for a contact just need a tel leading and a comma in between.  http://chart.googleapis.com/chart?cht=qr&chs=200x200&chl=MECARD:N:Dean,Collins;ADR:smith%20st,new%20york;TEL:9172073420,TEL:3332073420;EMAIL:dean@Cognation.net;URL:www.cognation.net;NOTE:this%20is%20a%20test

















And last but not least - Text Only :)
http://chart.googleapis.com/chart?cht=qr&chs=200x200&chl=the%20quick%20brown%20fox%20jumps%20over%20the%20lazy%20dog




















Hope you found this of interest feel free to post comments or even better more hidden functionality you find.

Cheers,
Dean

8 comments:

  1. Dean, the QR codes don't display for me (and I don't see them on your blog, either). I-nigma has a form-based QR code creator that allows you to embed <img> codes and works quite well.

    ReplyDelete
  2. The reason they dont appear is there seems to be some problem with accessing 11 codes at once from my personal web page - seems a blogger issue more than the google api issue.

    regarding i-nigma - stay away from it, their encoder is a piece of crap.

    i am very anti url-redirection.

    whats the point of having an encoder that relies on a third party server to provide a redirection.

    people need to understand the whole point of qr codes is to have the information embedded in the code, not rely on some third party server to redirect you to the correct site.

    what happens when inigma turns off their server? all the codes you have deployed are screwed.

    or worse - they track how many hits you are getting and turn around and say you need to pay us money otherwise we are going to turn your codes off - holding you hostage.

    url redirection is a shitty trick, dont fall for it.

    stick with one of the other encoders that dont implement redirection into your codes - they're your codes use them how you want to.


    Cheers,
    Dean

    ReplyDelete
  3. Someone emailed me asking for more of an explanation why url redirection (eg inigma) is a very very bad idea in qr codes.



    google api creates the api but when your reader views it - the browser is delivered the actual url and sent directly to the content.

    inigma is a url redirection encoder.

    meaning when they encode your qr code they dont actually provide your url in the code they provide one of their own urls - which is then redirected to your website. normally something like www.i-nigma.com/1234dre4556k

    so if inigma go tits up tomorrow and or withdraw their service (and or start to charge you for it) then you are screwed and all the qr's you deployed no longer work.

    in the google example, apart from the actual initial encoding google has no ongoing involvement. so if they withdraw their api etc doesn't matter at all - the qr image sends users directly to your url.

    does that make sense? there is a big difference.

    Inigma are looking to 'create' a business model where no problem actually exists in the first place.


    Cheers,
    Dean

    ReplyDelete
  4. hi, I dont fully agree with you about redirection on QR Codes. Redirection has a big advantage! For example, if you want to change the link your code is sending people to, then, without redirection you would have to change every single QRCodes you have (if they are on fisical things like posters or shirts or whatever it would be almost imposible to do). However, if you use redirection you only need to change a parameter on the server you are using for redirecting.
    So, even tho I agree with you that the companys who give this redirecting service may at some point take advantage of their clients, you cant overlook or discard this functionality.

    By the way, do you know of any API or SDK for making your own encoding sofware? I blelieve google only has a decoding API for developers (ZXING).

    ReplyDelete
  5. Hi JP, thanks for your comment.

    I think you are mistaken. You can set up your own 'redirection' by having the qr code resolve to a URL and then having either the content at that url change or for you to use your own url redirection.

    The problem with using a redirection service provided by someone else is if they close you are screwed, or if they start charging hi fees etc you are screwed.

    There are plenty of API's to creating your own QR codes, check out Winksite as an example.

    As for creating your own software using a SDK google the 'swetake' software as a starting point.


    Cheers,
    Dean

    ReplyDelete
  6. Which contact format standard do you recommend me, VCard or MECARD?

    ReplyDelete
  7. Yeh it's a tough decision and to be honest both are valid choices.

    I tend to use Vcard though.

    ReplyDelete
  8. Dean, thanks for the info. I'm researching QR codes. What do you think of QRstuff.com? I'm looking into best ways to create and use QR codes for clients. I've tested i-nigma and beetagg readers. The i-nigma reader seems very robust. Has read everything I threw at it from various QR code generators. But the redirect thing concerns me. The Beetagg reads everything I've tried, but often just shows text/code instead of, for instance, reading a phone number properly and making it accessible on an iPhone to dial.

    ReplyDelete