Start a Project

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

Exit mobile version