How to scan QRCode in android

前端 未结 7 2305
说谎
说谎 2020-12-25 14:04

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?

7条回答
  •  旧巷少年郎
    2020-12-25 14:42

    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.

提交回复
热议问题