How to scan QRCode in android

前端 未结 7 2295
说谎
说谎 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 15:02

    Step by step to setup zxing 3.2.1 in eclipse

    1. Download zxing-master.zip from "https://github.com/zxing/zxing"
    2. Unzip zxing-master.zip, Use eclipse to import "android" project in zxing-master
    3. Download core-3.2.1.jar from "http://repo1.maven.org/maven2/com/google/zxing/core/3.2.1/"
    4. Create "libs" folder in "android" project and paste cor-3.2.1.jar into the libs folder
    5. Click on project: choose "properties" -> "Java Compiler" to change level to 1.7. Then click on "Android" change "Project build target" to android 4.4.2+, because using 1.7 requires compiling with Android 4.4
    6. If "CameraConfigurationUtils.java" don't exist in "zxing-master/android/app/src/main/java/com/google/zxing/client/android/camera/". You can copy it from "zxing-master/android-core/src/main/java/com/google/zxing/client/android/camera/" and paste to your project.
    7. Clean and build project. If your project show error about "switch - case", you should change them to "if - else".
    8. Completed. Clean and build project Reference link: How to use Zxing in android

提交回复
热议问题