QR Coder for Mobile Devices

Being a mobile app developer, I have to keep few devices around me all day for debugging and testing my apps. Nowadays, all smartphones come with Bluetooth, WiFi and now NFC technologies, but they all fail to talk to each other for even simple text data exchange.

I find myself in situations where I need to quickly get piece of text from one device to another. It could be a link, some text copied from browser, or SMS message I received on one device, and need to get on other device without messing around with apps or wires.

QRCoder-demo

Yesterday this idea came to my mind when I was reading a lengthy article on my HTC Titan and received system notification that I need to recharge or else phone will power off. I wanted to quickly open the same article on my Nokia E7 which I was also carrying with me.

As I described earlier, that we currently don’t have any standard way to get these devices talk to each other directly without going through the “cloud”, so I was stuck there.

I quickly jumped back to my seat, and started some experiments. After an hour I did my first test and and it was a success!

I wrote a tiny JavaScript which can be added into mobile browser’s favorites, and when you need to share current page’s link with another device, you can just go to that saved Favorite, which will execute my JavaScript, which will finally render a QR Code right on top of the page.

Now you just need to point your other smartphone or tablet camera to it with a QR Code reader app of course (built-in in WP and other OS’s), and voila! The link will now open up.

It works in PC browsers as well, so if you need to quickly open a link on your tablet or smartphone from PC, you can save this in bookmarks toolbar in IE/Chrome/FF/Safari, and click it to instantly make a QR code for current link.

I tested it on all major PC browsers, and on my Nokia E7 and HTC Titan. Works great! It should run on all mobile browsers which support editing of bookmark URL, so you can insert the code there.

BTW, I used old Google Charts APIs to make the QR codes.

And finally here’s the code which you can copy and save as favorite in your mobile browser.

Remember, there are no line breaks in this code. It’s just one long line of JavaScript code :)

Step by step guide:

  • Select and copy the above JavaScript code. On PC, do triple-click on code to select all code
  • Open web browser on mobile or PC
  • Add / save this page as bookmark or favorite
  • Now select and edit the saved bookmark
  • In name field, type “! QRCoder”. The character in start makes sure the bookmark is always on top of the list in your bookmarks list. Easy to tap :)
  • In Location / Address field, just paste the JavaScript code you copied in first step.
  • Ok / Done to save. Now go to any website and from bookmarks / favorites, tap on “! QRCoder”

To quickly land on this page, scan this QR code from your smartphone or tablet:

qrcoder-chall3ng3r

Tested on following devices / OS:

  • PC / Mac / Linux – Check
  • iPhone, iPad – Check
  • Windows Phone 7.5 – Check
  • Symbian Anna / Belle – Check
  • Z10 / BB10 – Check
  • ToDo: Android

I know when this gets published, many non-techy users are going ask how to save this code in mobile browser as favorite. So, here’s a little video demonstration on a Windows Phone:


[YouTube link for mobile viewing]

Kindly ignore audio/video quality and any narration mistakes, this is my first ever video, done really quick :D

It’s a quick and dirty hack to solve a problem. You can also hack it further as per your liking.

I would love to hear any feedback or a tweet :)

// chall3ng3r //

31 thoughts on “QR Coder for Mobile Devices”

  1. This is cool! I wish it was a WP exclusive! That way O can brag about the functionality, oh well I will anyways. Thanks for the..app? What kind of utility is this called anyways?

  2. Nice hack!
    I am curious, do you know how many characters are allowed to be pasted for the URL in the favorite?

  3. @Andrei, QR code can store up to 7089 characters. I guess you wanted to know how long URLs one can embed in a QR code.

    Well, 7089 characters are good enough for most links ;)

    // chall3ng3r //

  4. @Andrei, ahh… Now I get it what you asked. That depends on browser. Each browser have its own limit. I haven’t tested this yet, so not sure exactly.

    // chall3ng3r //

  5. I saw your work featured on wpcentral.com’s front page, and I have to say – This is awesome! Great work, Faisal!

  6. This is very cool. I was using a web form before to get my Axure prototype links via QR code in my device.
    But this is even more convenient.
    Thanks!

    1. @HAYSTACK510, on PC, just add same page you are visiting in bookmarks. Then righ-click the bookmark, select properties/edit. Now you can change the bookmark’s name, and paster the code in Location/Address field. Will post a screen cast for it as well.

      // chall3ng3r //

  7. Thanks for share it. I have tested in
    * WP7 Tango OK
    * PC Google Chrome OK
    * PC Firefox OK
    * PC Opera 11.62 OK
    * PC IE 9 Fail.

  8. @jb, thanks for your tests.

    @Patters, thanks for reporting. Yes it looks like the url is not getting correctly processed for QR Coder. I will try with url-encode and update it here if it fixes the issue.

    // chall3ng3r //

    1. Anthony, I think the JS code in Firefox bookmark might be not correctly set. Try copying the QRCoder JS code again and setting it as bookmark’s address/URL field.

      I also use Firefox as my primary browser and code is working good for me.

      Give it a try and let me know if you still can’t get it working.

      Best,

      // chall3ng3r //

      1. I tried again and I’m still getting the little square to pop up, but the actual QR code image is broken. Here’s a link to what it looks like:
        https://plus.google.com/photos/117932504663135231639/albums/6011773349356671713?authkey=CJD43OS9qMqOGg

        I did what I did before, which was go to your code example, click the “copy” icon, create a bookmark, edit the bookmark, paste the code into the address bar/url field, then go to a site and select it.
        Here’s what my bookmarks area looks like: https://picasaweb.google.com/117932504663135231639/May102014?authuser=0&feat=directlink

        I’m using Firefox 29.0.1 on a Win7 machine (AMD A6, 6GB ram, 1TB hd)

  9. I’m having the same problem that Anthony reported above. I just get an image holder pop up rather than a QR code. I’ve tried both Chrome and Firefox, using a Macbook. Did you find out what might be going on?
    This is SO cool I’m hoping you found a fix!
    Thanks,
    Linda

Leave a Reply