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.



. . .
Discuss on Helpdesk

Leave a Comment

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


  • Android Team
    This my QRCodeRead result method

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


    how to fix this error please help

  • 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