A library that uses google's mobile vision api and simplify the QR code reading process

View the Project on GitHub nisrulz/qreader



Badges/Featured In

Android Arsenal

Show some ❤️

GitHub stars GitHub forks GitHub watchers GitHub followers Twitter Follow

Android library which makes use of Google's Mobile Vision API to enable reading QR Code.

The library is built for simplicity and ease of use. It not only eliminates most boilerplate code for dealing with setting up QR Code reading , but also provides an easy and simple API to retrieve information from QR Code quickly.


Starting with 1.0.4, Changes exist in the releases tab.


QREader is available in the Jcenter, so getting it as simple as adding it as a dependency

compile 'com.github.nisrulz:qreader:{latest version}'

where {latest version} corresponds to published version in Download

Usage Docs


  1. Add a SurfaceView to your layout

  2. Setup SurfaceView and QREader in onCreate()

    // QREader
    private SurfaceView mySurfaceView;
    private QREader qrEader;
    protected void onCreate(final Bundle savedInstanceState) {
      // Setup SurfaceView
      // -----------------
      mySurfaceView = (SurfaceView) findViewById(R.id.camera_view);
      // Init QREader
      // ------------
      qrEader = new QREader.Builder(this, mySurfaceView, new QRDataListener() {
        public void onDetected(final String data) {
          Log.d("QREader", "Value : " + data);
          text.post(new Runnable() {
            public void run() {
  3. Initialize and Start in onResume()

      protected void onResume() {
        // Init and Start with SurfaceView
        // -------------------------------
  4. Cleanup in onPause()

      protected void onPause() {
        // Cleanup in onPause()
        // --------------------
  5. Some provided utility functions which you can use

    • To check if the camera is running

      boolean isCameraRunning = qrEader.isCameraRunning()
    • To stop QREader

    • To start QREader

    Check the included sample app for a working example.

Pull Requests

I welcome and encourage all pull requests. It usually will take me within 24-48 hours to respond to any issue or request. Here are some basic rules to follow to ensure timely addition of your request:

  1. Match coding style (braces, spacing, etc.) This is best achieved using CMD+Option+L (Reformat code) on Mac (not sure for Windows) with Android Studio defaults.
  2. If its a feature, bugfix, or anything please only change code to what you specify.
  3. Please keep PR titles easy to read and descriptive of changes, this will make them easier to merge :)
  4. Pull requests must be made against develop branch. Any other branch (unless specified by the maintainers) will get rejected.
  5. Check for existing issues first, before filing an issue.
  6. Have fun!

Created & Maintained By

Nishant Srivastava (@nisrulz)

If you found this library helpful or you learned something from the source code and want to thank me, consider buying me a cup of ☕️

Buy Me a Coffee at ko-fi.com