Read More

scanning QR code using ZXING library

What is QR Code?

QR is an acronym for Quick Response. It’s a smarter version of the barcode, and it was originally developed in Japan for the automotive industry. Machines can read QR codes more quickly than barcodes, and QR codes can store more data in less space too.

Implementing QR Scanner by using ZXING Library- it provides easiest way to implement a QR code Scanner for developers.

following steps to use this library.

  1. add the dependency to app level build.gradle

     
    • Add a “QRCodeReaderView” in the layout editor like you actually do with a button for example.
    • In your onCreate method, you can find the view, as usual, using findViewById() function.
    • Create an Activity which implements,onQRCodeReadListener and let implements required methods or set a onQRCodeReadListener to the QRCodeReaderView object.

       
  2. Make sure you have camera permissions in order to use the library.
  3. Start & Stop camera preview in onPause() and onResume() overriden methods.
  4. You can place widgets or views over QRDecoderView.

 

References: https://github.com/dlazaro66/QRCodeReaderView

. . .

Comments (2)

Add Your Comment

  • Android Team
    This my QRCodeRead result method

    @Override
    public void onQRCodeRead(final String result, PointF[] points) {
    runOnUiThread(new Runnable() {
    @Override
    public void run() {
    Toast.makeText(ScanActivity.this, result, Toast.LENGTH_SHORT).show();
    }
    });

    }

    how to fix this error please help

    https://uploads.disquscdn.com/images/55c7f6b5fce472a84b441397da4878134577c9ac373d38953805cc530c017cd1.png

  • Raju Shingadiya
    camera preview is shreched in some device
  • css.php
    Hire Us!
    Brief us about your requirements and we'll get back to you.
    Woo! Hooy!
    We have just recieved your project brief and our expert will contact you shortly.
    Send Again
    Close