scanning QR code using ZXING library

Save

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

. . .
Discuss on Helpdesk

Leave a Comment

Your email address will not be published. Required fields are marked*


2 comments

  • 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
    Start a Project


      Message Sent!

      If you have more details or questions, you can reply to the received confirmation email.

      Back to Home