17

I wish to use QR codes in a PhoneGap-based mobile app. There are several ways to generate QR codes using javascript. I'm using Jerome Etienne's jquery-based solution.

I'm looking for a pure Javascript solution or a set of PhoneGap plugins for the camera-enabled platforms that will read QR encoded data in an image.

So far all I've found is a demo by LazarSoft. Are there any other solutions?

Community
  • 1
  • 1
Alec Wenzowski
  • 3,878
  • 3
  • 25
  • 40

5 Answers5

11

UPDATE I finally put up my demo using jsqrcode. Try it here.

These http://www.webqr.com/ guys have actually ported the ZXing qrcode scanner to javascript https://github.com/LazarSoft/jsqrcode !!

The only thing you need the flash thing for is to use the webcam (in their examples). The javascript decode and detection works on canvas elements.

I'm currently using the HTML5 Camera API and the javascript bits from LazarSoft to detect and decode QR codes in the browser. Pure web :-D

For desktop testing set the Enable MediaStream flag under chrome:flags, or get the camera bundled client from Opera Labs http://snapshot.opera.com/labs/camera/

asbjornenge
  • 1,209
  • 13
  • 16
  • Any plans to release a library for that Camera/QR tie-in? :D – Rob Howard Aug 01 '12 at 03:22
  • 1
    Nah, not yet anyway. Too many factors are still too immature for it work properly. We made it work, but actually went for a native app instead because of performance and other issues. I could send you the code if you want...? – asbjornenge Aug 02 '12 at 20:35
  • That would be great if you could. :) Maybe gist it up or post a repo? (I'm damncabbage on GitHub and Twitter.) – Rob Howard Aug 14 '12 at 04:54
  • @asbjornenge did you find out how to make webqr work and decode qrcodes? Me i can't understand how to make it read from webcam/canvas, i copied the site files js/html and saved camcanvas.swf ... but it doesn't show me the decoded text :( – itsme Oct 10 '12 at 08:18
  • I haven't worked on this for a long time, but I managed to dig up the old "app" I was working on way back. You can find it here: https://github.com/asbjornenge/jsqrcode-scanner hope that helps a little. Sorry it took so long :-/ – asbjornenge Feb 18 '13 at 20:22
  • Ive wanted to use this for iphones, it works with camera function taking a picure with ios8 but not ios7. Using the video stream to capture qrcodes would be ideal but does not seem supported on iphones :( – Andy Stannard Oct 29 '14 at 11:18
6

This is the current go to library for barcode scanning: https://github.com/wildabeast/BarcodeScanner

Now the official cross-platform BarcodeScanner for Cordova / PhoneGap https://github.com/phonegap/phonegap-plugin-barcodescanner

Mahdi Esmaeili
  • 555
  • 7
  • 11
Bijan
  • 25,559
  • 8
  • 79
  • 71
5

See also this Tutorial which shows how to make a PhoneGap app using the Barcode Scanner plugin that uses the Zebra Crossing library

Paul Beusterien
  • 27,542
  • 6
  • 83
  • 139
4

This one looks nice. According with their own description:

Using Lazar Laszlo's port of ZXing Java library, QCodeDecoder brings to the web a great interface for dealing with QRCode decoding, being usable both on desktops and mobile phones.

Demo: http://cirocosta.github.io/qcode-decoder/

Repository: https://github.com/cirocosta/qcode-decoder

Uilian
  • 656
  • 8
  • 19
1

Check these out:

http://openalexandria.com/2010/10/qrcode-decode-javascript-read-qr-code-with-javascript

http://pt.sourceforge.jp/projects/jpqr

Ali Ben Messaoud
  • 11,690
  • 8
  • 54
  • 87
rb512
  • 6,880
  • 3
  • 36
  • 55
  • Thanks for this. I had difficulty actually finding the code on sourceforge.jp so I forked it to github once I figured out how to get the svn repo off the site. https://github.com/wenzowski/jpqr – Alec Wenzowski Oct 12 '11 at 00:58
  • But this jpqr thing does qr-code decoding only, right? Did you ever find anything for doing qr-code detection in images? – asbjornenge Jun 29 '12 at 07:31