How to scan QRCode in android

Sunil Kumar Sahoo picture Sunil Kumar Sahoo · Jan 12, 2012 · Viewed 26.9k times · Source

I found a tutorial on how to scan a barcode. But in my application I have to scan a QR code. How can I a scan QR code in Android?

Answer

Dan Dascalescu picture Dan Dascalescu · Aug 11, 2016

2016 update

The current recommendation is to use the Android Barcode API, which works locally (offline), without requiring a server roundtrip:

The Barcode API detects barcodes in real-time, on device, in any orientation. It can also detect multiple barcodes at once.

It reads the following barcode formats:

  • 1D barcodes: EAN-13, EAN-8, UPC-A, UPC-E, Code-39, Code-93, Code-128, ITF, Codabar
  • 2D barcodes: QR Code, Data Matrix, PDF-417, AZTEC

It automatically parses QR Codes, Data Matrix, PDF-417, and Aztec values, for the following supported formats:

  • URL
  • Contact information (VCARD, etc.)
  • Calendar event
  • Email
  • Phone
  • SMS
  • ISBN
  • WiFi
  • Geo-location (latitude and longitude)
  • AAMVA driver license/ID

Check out the codelab - Barcode Detection with the Mobile Vision API.