21
Jul
image[11]

In today's Android-enabled world, QR codes play quite an important role because, face it, who wants to type that long, pesky URL on your phone's keyboard when you can just quickly scan an image and have the URL decoded in a split second?

Why do I say with such confidence that QR codes are now a commodity? Have a look at this awesome chart AppBrain posted yesterday. See Barcode Scanner, whose primary purpose is to scan QR codes? A whopping 63.8% of Android users have it installed on their phones - in fact it's the #3 most installed application.

image

Every respectable Android site uses QR codes in one way or another - sites like AppBrain offer a QR code on every application page, and when we do app roundups, like this 8 Great Apps Every Rooted Android User Should Know About one, we try to include QR images as well.

Of course, Froyo has the ability to push links between your phone and your browser directly, as we discussed here, but Froyo will take some time to spread, and won't ever arrive to some phones. Additionally, you'd need to have an add-on or extension handy, which is not always the case.

Tip #1

But enough introduction. The tip here today lets you create QR images so mind blowingly fast that you will never have to type a long url into your phone's browser again [if you're next to your computer].

The premise is simple: Google Charts API is awesome enough to include QR generating capabilities. If you load up this url:

and append any url after it, you will instantly get yourself a nice QR code.

For example,

produces:

image

If I read this image with Barcode Scanner, here's what I get:

snap20100721_202215

If you want to vary the size of the generated QR code, just adjust the chs parameter. Follow this API link for more info about the rest of the parameters.

Excellent. What I did at first was save the first URL above in a bookmark named QR in my Firefox Bookmarks Toolbar for quick access.

This worked great for a while, but still wasn't good enough as it required 2 page loads - 1 to load the bookmark and 1 to reload it with the URL I want the QR code for.

Tip #1, meet tip #2.

Tip #2

The second tip will speed up what we got in the first one to 0 clicks and a single operation. However, it only works in Firefox, which you, hopefully, are already using.

  1. Right click on the bookmark you've created in tip #1, go to Properties, and add a Keyword "qr".
  2. Append "%s" at the end of the URL to produce this: http://chart.apis.google.com/chart?cht=qr&chs=150x150&chl=%s
  3. Save your bookmark.

image

Now, whenever you need to generate a URL to a page, go to the Firefox URL bar and type in

"qr", space, URL, Enter

where URL is the address you want to encode in the QR code.

Alternatively, if you're already on a site you want to encode, just go to the URL bar

hit Home, "qr", space, and Enter

Brilliantly simple, isn't it?

Credit goes to this Reddit post for tip #2.

Side question: What is your best Android related tip?

Artem Russakovskii
Artem is a die-hard Android fan, passionate tech blogger, obsessive-compulsive editor, bug hunting programmer, and the founder of Android Police.
Most of the time, you will find Artem either hacking away at code or thinking of the next 15 blog posts.

  • Dmitry Soloviev

    QR codes have been around for years. I saw some on Japanese sites 5 years ago...

    • http://www.AndroidPolice.com Artem Russakovskii

      I never said they aren't new, but if you found use for them 3 years+ ago, I'd wonder what the heck you were using. Even a year ago, they weren't nearly as popular.

  • Digitaloracle86
  • http://www.google.com/profiles/kylehase KyleHase

    Cool tips. It's like Froyo's ChrometoPhone except it works for any android version and in Firefox.

  • http://brian.onmix.co.uk bcpk

    You can do #2 with Chrome and Opera also. In Chrome you right-click the location bar and click Edit Search Engines, and in Opera you... I don't remember. Something similar.

  • RastaCre

    I made this bookmarklet that generates a QR code for the current page:

    simply create a new bookmark and use the following code for the location:

    javascript:void((function(){j=document.createElement(%22SCRIPT%22);j.src=%22http://dl.dropbox.com/u/6703853/Scripts/QRgen.js%22;document.getElementsByTagName(%22HEAD%22)[0].appendChild(j);})())

    when on a page u can click on the bookmark and the generated code will appear on the top right corner of your browser.

    Enjoy

    • http://www.focuszonedevelopment.com Aaron

      Hah, I read this article and thought the same thing to myself: "Why not just use a bookmarklet?" I was going to create a quick one, but saw your post and it's far superior to anything I would've thought about :) Excellent work!

      • Matt

        Or to have custom content other than the url of the current page:

        javascript:Qr=document.getSelection();if(!Qr){void(Qr=prompt('Enter%20content%20of%20QR%20code:',''))}if(Qr)location.href='http://chart.apis.google.com/chart?chs=300x300&cht=qr&chld=L%7C1&choe=UTF-8&chl='+escape(Qr)+'%20'

  • http://www.layh.com Thomas

    Awesome, I like it. Thanks for the post.

  • ugly computer

    for chrome, ionno about extension, but i just made this:

    javascript:l=document.location; document.location.href='http://chart.apis.google.com/chart?chs=150x150&cht=qr&chld=L|1&choe=UTF-8&chl='+l;

    paste that into the URL of a new bookmark, clicking "add page" on the bookmarks bar...

    this opens in current tab, guess it's easy to open it in a new tab or a popup

  • Glenn

    Of course you can always use an Accelerator for IE8.

    Have a look at this neat site:
    http://deletethis.net/dave/?q=accelerator

  • http://browsersize.googlelabs.com/ DS
  • Kevin D

    even faster to use this

    http://qrcode.kaywa.com/

    and not just limited to URLs

  • Chris

    Or, well, if you have IE and the JS library site is blocked, you can use this code:

    javascript:myURL='http://chart.apis.google.com/chart?chs=300x300&cht=qr&chld=L%7C1&choe=UTF-8&chl='+escape(location.href)+'%20';window.open(myURL,'_newtab', 'toolbar=0,location=0,directories=0,status=0,menubar=0,scrollbars=0,width=320,height=320');location.href=location.href;

    I wanted for this to open in a new tab; instead, it's a new window, which doesn't bother me, really.

  • Dragon5150

    Great article. Works flawlessly in Chromium as well.

  • @MasterBarberWms

    why do i need this i just downloaded this

Quantcast