Read QR codes using google's mobile vision api, but without the hassle

Overview

Image

Specs

API

Badges/Featured In

Android Arsenal AndroidDev Digest

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.

Requires Google Play Services

Changelog

Starting with 1.0.4, Changes exist in the releases tab.

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

  • For gradle version < 4.0

    compile 'com.github.nisrulz:qreader:{latest version}'
  • For gradle 4.0+

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

where {latest version} corresponds to published version in Download

Usage Docs

Steps

  1. Add a SurfaceView to your layout
">
<SurfaceView
  android:id="@+id/camera_view"
  android:layout_width="match_parent"
  android:layout_height="match_parent"
  android:layout_above="@+id/info"
  />
  1. Setup SurfaceView and QREader in onCreate()
// QREader
private SurfaceView mySurfaceView;
private QREader qrEader;
..

@Override
protected void onCreate(final Bundle savedInstanceState) {
  super.onCreate(savedInstanceState);
  setContentView(R.layout.activity_main);
  ..
  ..

  // Setup SurfaceView
  // -----------------
  mySurfaceView = (SurfaceView) findViewById(R.id.camera_view);

  // Init QREader
  // ------------
  qrEader = new QREader.Builder(this, mySurfaceView, new QRDataListener() {
    @Override
    public void onDetected(final String data) {
      Log.d("QREader", "Value : " + data);
      text.post(new Runnable() {
        @Override
        public void run() {
          text.setText(data);
        }
      });
    }
  }).facing(QREader.BACK_CAM)
      .enableAutofocus(true)
      .height(mySurfaceView.getHeight())
      .width(mySurfaceView.getWidth())
      .build();

}
  1. Initialize and Start in onResume()
  @Override
  protected void onResume() {
    super.onResume();

    // Init and Start with SurfaceView
    // -------------------------------
    qrEader.initAndStart(mySurfaceView);
  }
  1. Cleanup in onPause()
  @Override
  protected void onPause() {
    super.onPause();

    // Cleanup in onPause()
    // --------------------
    qrEader.releaseAndCleanup();
  }
  1. Some provided utility functions which you can use
  • To check if the camera is running

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

    qrEader.stop();
  • To start QREader

    qrEader.start();
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

  • PayPal
  • Bitcoin Address: 13PjuJcfVW2Ad81fawqwLtku4bZLv1AxCL
Comments
  • Failed resolution of: Lcom/google/android/gms/internal/zzdcc;

    Failed resolution of: Lcom/google/android/gms/internal/zzdcc;

    Here is my function :

     private void initQRReader() {
    
            try {
                if (qrEader != null && qrEader.isCameraRunning()) {
                    qrEader.releaseAndCleanup();
                }
    
                qrEader = new QREader.Builder(context, binding.cameraView, new QRDataListener() {
                    @Override
                    public void onDetected(final String data) {
    
                       //My work
                    }
                }).facing(QREader.BACK_CAM)
                        .enableAutofocus(true)
                        .height(binding.cameraView.getHeight())
                        .width(binding.cameraView.getWidth())
                        .build();
            } catch (Exception e) {
                e.printStackTrace();
                toast("Sorry scanner is not supported on this device.");
            }
        }
    

    And also followed onResume and onPause methods to make this thing work. Please help me.

    Facing this issue. Suddenly it started with version 2.1.2 now its even not working with 2.1.1

    01-03 10:22:22.227 6808-6808/com.Invoice.maker E/AndroidRuntime: FATAL EXCEPTION: main Process: com.Invoice.maker, PID: 6808 java.lang.NoClassDefFoundError: Failed resolution of: Lcom/google/android/gms/internal/zzdcc; at com.google.android.gms.vision.barcode.BarcodeDetector$Builder.(Unknown Source:5) at github.nisrulz.qreader.BarcodeDetectorHolder.getBarcodeDetector(BarcodeDetectorHolder.java:38) at github.nisrulz.qreader.QREader.(QREader.java:104) at github.nisrulz.qreader.QREader.(QREader.java:40) at github.nisrulz.qreader.QREader$Builder.build(QREader.java:357) at com.invoiceapp.Main.CodeScannerActivity.initQRReader(CodeScannerActivity.java:109) at com.invoiceapp.Main.CodeScannerActivity.access$000(CodeScannerActivity.java:22) at com.invoiceapp.Main.CodeScannerActivity$1.onGranted(CodeScannerActivity.java:40) at com.invoiceapp.Main.BaseActivity$27.onPermissionsGranted(BaseActivity.java:3636) at com.kishan.askpermission.AskPermissionImp.requestAppPermissions(AskPermissionImp.java:71) at com.kishan.askpermission.ShadowFragment.onCreate(ShadowFragment.java:41) at android.app.Fragment.performCreate(Fragment.java:2489) at android.app.FragmentManagerImpl.moveToState(FragmentManager.java:1237) at android.app.FragmentManagerImpl.addAddedFragments(FragmentManager.java:2407) at android.app.FragmentManagerImpl.executeOpsTogether(FragmentManager.java:2186) at android.app.FragmentManagerImpl.removeRedundantOperationsAndExecute(FragmentManager.java:2142) at android.app.FragmentManagerImpl.execPendingActions(FragmentManager.java:2043) at android.app.FragmentManagerImpl.dispatchMoveToState(FragmentManager.java:3032) at android.app.FragmentManagerImpl.dispatchActivityCreated(FragmentManager.java:2979) at android.app.FragmentController.dispatchActivityCreated(FragmentController.java:178) at android.app.Activity.performCreate(Activity.java:7005) at android.app.Activity.performCreate(Activity.java:6990) at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1214) at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2731) at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2856) at android.app.ActivityThread.-wrap11(Unknown Source:0) at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1589) at android.os.Handler.dispatchMessage(Handler.java:106) at android.os.Looper.loop(Looper.java:164) at android.app.ActivityThread.main(ActivityThread.java:6494) at java.lang.reflect.Method.invoke(Native Method) at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:438) at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:807) Caused by: java.lang.ClassNotFoundException: com.google.android.gms.internal.zzdcc at java.lang.VMClassLoader.findLoadedClass(Native Method) at java.lang.ClassLoader.findLoadedClass(ClassLoader.java:738) at java.lang.ClassLoader.loadClass(ClassLoader.java:363) at java.lang.ClassLoader.loadClass(ClassLoader.java:312) at com.google.android.gms.vision.barcode.BarcodeDetector$Builder.(Unknown Source:5)  at github.nisrulz.qreader.BarcodeDetectorHolder.getBarcodeDetector(BarcodeDetectorHolder.java:38)  at github.nisrulz.qreader.QREader.(QREader.java:104)  at github.nisrulz.qreader.QREader.(QREader.java:40)  at github.nisrulz.qreader.QREader$Builder.build(QREader.java:357)  at com.invoiceapp.Main.CodeScannerActivity.initQRReader(CodeScannerActivity.java:109)  at com.invoiceapp.Main.CodeScannerActivity.access$000(CodeScannerActivity.java:22)  at com.invoiceapp.Main.CodeScannerActivity$1.onGranted(CodeScannerActivity.java:40)  at com.invoiceapp.Main.BaseActivity$27.onPermissionsGranted(BaseActivity.java:3636)  at com.kishan.askpermission.AskPermissionImp.requestAppPermissions(AskPermissionImp.java:71)  at com.kishan.askpermission.ShadowFragment.onCreate(ShadowFragment.java:41)  at android.app.Fragment.performCreate(Fragment.java:2489)  at android.app.FragmentManagerImpl.moveToState(FragmentManager.java:1237)  at android.app.FragmentManagerImpl.addAddedFragments(FragmentManager.java:2407)  at android.app.FragmentManagerImpl.executeOpsTogether(FragmentManager.java:2186)  at android.app.FragmentManagerImpl.removeRedundantOperationsAndExecute(FragmentManager.java:2142)  at android.app.FragmentManagerImpl.execPendingActions(FragmentManager.java:2043)  at android.app.FragmentManagerImpl.dispatchMoveToState(FragmentManager.java:3032)  at android.app.FragmentManagerImpl.dispatchActivityCreated(FragmentManager.java:2979)  at android.app.FragmentController.dispatchActivityCreated(FragmentController.java:178)  at android.app.Activity.performCreate(Activity.java:7005)  at android.app.Activity.performCreate(Activity.java:6990)  at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1214)  at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2731)  at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2856)  at android.app.ActivityThread.-wrap11(Unknown Source:0)  at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1589)  at android.os.Handler.dispatchMessage(Handler.java:106)  at android.os.Looper.loop(Looper.java:164)  at android.app.ActivityThread.main(ActivityThread.java:6494)  at java.lang.reflect.Method.invoke(Native Method)  at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:438)  at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:807)  Caused by: java.lang.NoClassDefFoundError: Failed resolution of: Lcom/google/android/gms/internal/zzbck; at com.google.android.gms.vision.barcode.BarcodeDetector$Builder.(Unknown Source:5)  at github.nisrulz.qreader.BarcodeDetectorHolder.getBarcodeDetector(BarcodeDetectorHolder.java:38)  at github.nisrulz.qreader.QREader.(QREader.java:104)  at github.nisrulz.qreader.QREader.(QREader.java:40)  at github.nisrulz.qreader.QREader$Builder.build(QREader.java:357)  at com.invoiceapp.Main.CodeScannerActivity.initQRReader(CodeScannerActivity.java:109)  at com.invoiceapp.Main.CodeScannerActivity.access$000(CodeScannerActivity.java:22)  at com.invoiceapp.Main.CodeScannerActivity$1.onGranted(CodeScannerActivity.java:40)  at com.invoiceapp.Main.BaseActivity$27.onPermissionsGranted(BaseActivity.java:3636)  at com.kishan.askpermission.AskPermissionImp.requestAppPermissions(AskPermissionImp.java:71)  at com.kishan.askpermission.ShadowFragment.onCreate(ShadowFragment.java:41)  at android.app.Fragment.performCreate(Fragment.java:2489)  at android.app.FragmentManagerImpl.moveToState(FragmentManager.java:1237)  at android.app.FragmentManagerImpl.addAddedFragments(FragmentManager.java:2407)  at android.app.FragmentManagerImpl.executeOpsTogether(FragmentManager.java:2186)  at android.app.FragmentManagerImpl.removeRedundantOperationsAndExecute(FragmentManager.java:2142)  at android.app.FragmentManagerImpl.execPendingActions(FragmentManager.java:2043)  at android.app.FragmentManagerImpl.dispatchMoveToState(FragmentManager.java:3032)  at android.app.FragmentManagerImpl.dispatchActivityCreated(FragmentManager.java:2979)  at android.app.FragmentController.dispatchActivityCreated(FragmentController.java:178)  at android.app.Activity.performCreate(Activity.java:7005)  at android.app.Activity.performCreate(Activity.java:6990)  at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1214)  at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2731)  at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2856)  at android.app.ActivityThread.-wrap11(Unknown Source:0)  at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1589)  at android.os.Handler.dispatchMessage(Handler.java:106)  at android.os.Looper.loop(Looper.java:164)  at android.app.ActivityThread.main(ActivityThread.java:6494)  at java.lang.reflect.Method.invoke(Native Method)  at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:438)  at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:807)  Caused by: java.lang.ClassNotFoundException: Didn't find class "com.google.android.gms.internal.zzbck" on path: DexPathList[[zip file "/data/app/com.Invoice.maker-g0I69RbPTxHTnyU9ounT5A==/base.apk"],nativeLibraryDirectories=[/data/app/com.Invoice.maker-g0I69RbPTxHTnyU9ounT5A==/lib/x86, /data/app/com.Invoice.maker-g0I69RbPTxHTnyU9ounT5A==/base.apk!/lib/x86, /system/lib, /vendor/lib]] at dalvik.system.BaseDexClassLoader.findClass(BaseDexClassLoader.java:125) at java.lang.ClassLoader.loadClass(ClassLoader.java:379) at java.lang.ClassLoader.loadClass(ClassLoader.java:312) at com.google.android.gms.vision.barcode.BarcodeDetector$Builder.(Unknown Source:5)  at github.nisrulz.qreader.BarcodeDetectorHolder.getBarcodeDetector(BarcodeDetectorHolder.java:38)  at github.nisrulz.qreader.QREader.(QREader.java:104)  at github.nisrulz.qreader.QREader.(QREader.java:40)  at github.nisrulz.qreader.QREader$Builder.build(QREader.java:357)  at com.invoiceapp.Main.CodeScannerActivity.initQRReader(CodeScannerActivity.java:109)  at com.invoiceapp.Main.CodeScannerActivity.access$000(CodeScannerActivity.java:22)  at com.invoiceapp.Main.CodeScannerActivity$1.onGranted(CodeScannerActivity.java:40)  at com.invoiceapp.Main.BaseActivity$27.onPermissionsGranted(BaseActivity.java:3636)  at com.kishan.askpermission.AskPermissionImp.requestAppPermissions(AskPermissionImp.java:71)  at com.kishan.askpermission.ShadowFragment.onCreate(ShadowFragment.java:41)  at android.app.Fragment.performCreate(Fragment.java:2489)  at android.app.FragmentManagerImpl.moveToState(FragmentManager.java:1237)  at android.app.FragmentManagerImpl.addAddedFragments(FragmentManager.java:2407)  at android.app.FragmentManagerImpl.executeOpsTogether(FragmentManager.java:2186)  at android.app.FragmentManagerImpl.removeRedundantOperationsAndExecute(FragmentManager.java:2142)  at android.app.FragmentManagerImpl.execPendingActions(FragmentManager.java:2043)  at android.app.FragmentManagerImpl.dispatchMoveToState(FragmentManager.java:3032)  at android.app.FragmentManagerImpl.dispatchActivityCreated(FragmentManager.java:2979)  at android.app.FragmentController.dispatchActivityCreated(FragmentController.java:178)  at android.app.Activity.performCreate(Activity.java:7005)  at android.app.Activity.performCreate(Activity.java:6990)  at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1214)  at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2731)  at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2856)  at android.app.ActivityThread.-wrap11(Unknown Source:0)  at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1589)  at android.os.Handler.dispatchMessage(Handler.java:106)  at android.os.Looper.loop(Looper.java:164)  at android.app.ActivityThread.main(ActivityThread.java:6494)  at java.lang.reflect.Method.invoke(Native Method)  at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:438)  at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:807) 

    bug 
    opened by babulpatel1309 15
  • Error building with proguard

    Error building with proguard

    I have build my project with proguard using QReader Libs but it throw error "can't find common super class ...LatLngBounds (google gms), but when I remove QReader Libs, my project build successfully. I've tried to add into proguard-rule.pro -dontwarn github.nisrulz.qreader.** -keep class github.nisrulz.qreader.** { *; }

    But error still appear. Please guide me how to fix this. Thanks

    opened by datnt1987 13
  • Error creating native barcode detector (Error with 4.2.2 only)

    Error creating native barcode detector (Error with 4.2.2 only)

    I am having this error : NativeBarcodeDetectorHandle: Error creating native barcode detector Because of that i got this one: QREader: Barcode recognition libs are not downloaded and are not operational

    This error is happening with Android 4.2.2 only, the same code runs perfectly fine with 5.1 and 6.0.

    Device: smartwatch with a full install of android. The sample code to detect the QrCodes hasn't been modified.

    No instant run.

    opened by hsaidi 11
  • Detector processor must first be set

    Detector processor must first be set

    E/CameraSource: Exception thrown from receiver. java.lang.IllegalStateException: Detector processor must first be set with setProcessor in order to receive detection results. at com.google.android.gms.vision.Detector.receiveFrame(Unknown Source) at com.google.android.gms.vision.CameraSource$zzb.run(Unknown Source) at java.lang.Thread.run(Thread.java:818)

    i use your sample code exactly, but recive this error

    opened by abbasalim 10
  • Google Play Services Conflict

    Google Play Services Conflict

    Issue occurred after including Google Firebase in my project

    java.lang.NoSuchMethodError: No static method zzC(Ljava/lang/Object;)Lcom/google/android/gms/dynamic/zzd; in class Lcom/google/android/gms/dynamic/zze; or its super classes (declaration of 'com.google.android.gms.dynamic.zze' appears in /data/app/com.remoteapps.vs-2/base.apk) at com.google.android.gms.vision.barcode.internal.client.zzd$zza.zzb(Unknown Source) at com.google.android.gms.vision.barcode.internal.client.zzd$zza.zza(Unknown Source) at com.google.android.gms.vision.barcode.internal.client.zzd.zzIg(Unknown Source) at com.google.android.gms.vision.barcode.internal.client.zzd.(Unknown Source) at com.google.android.gms.vision.barcode.BarcodeDetector$Builder.build(Unknown Source) at github.nisrulz.qreader.QREader.init(QREader.java:82)

    help wanted 
    opened by alon80 9
  • java.lang.IllegalStateException: Detector processor must first be set with setProcessor

    java.lang.IllegalStateException: Detector processor must first be set with setProcessor

    Using the sample application at: https://github.com/nisrulz/qreader/tree/master/app

    I am receiving an error every few milliseconds while the app is trying to detect a QR code.

    The error is:

    E/CameraSource: Exception thrown from receiver.
    java.lang.IllegalStateException: Detector processor must first be set with setProcessor in order to receive detection results.
    at com.google.android.gms.vision.Detector.receiveFrame(Unknown Source)
    at com.google.android.gms.vision.CameraSource$zzb.run(Unknown Source)
    at java.lang.Thread.run(Thread.java:818)
    
    opened by Warosaurus 9
  • Camera is stretched

    Camera is stretched

    Hello, I have created a layout on android with a simple menu of 50dp and under a "surfaceview" where I used the library of qr reader to read the qr code, only that the camera is stretched, I also tried to enter 50 dp margin to surface view to keep the spaces, but nothing has changed, how can I solve this problem?

    I used version 2.1.2 of the library

    Preview:

    0f87eb24-820b-480d-ab1e-b83c38809082

    opened by morra850 8
  • How can I read QR code once and stop QrReader

    How can I read QR code once and stop QrReader

    As in the examples, the QREeader reads continous. When I once read

     qreader = QREader.Builder(view.context, surface_view, QRDataListener { data ->
                printReadQrCode(data)
            }).facing(QREader.BACK_CAM)
                    .enableAutofocus(true)
                    .height(surface_view.height)
                    .width(surface_view.width)
                    .build()
        }
    

    Here it prints continueous the read data object as long as I hold the scanner to the qr code. I would like to call printReadQrCode(data) only once it was read successfully.. then stop the qreader and resume if required.

    also

    myTextView.post(new Runnable() {
                    @Override
                    public void run() {
                        myTextView.setText(data);
                    }
                });
    

    wont help, since I do not have any Views and I do not want to add artificially some View elements..

    opened by MrSilverstein 7
  • Barcode recognition libs are not downloaded and are not operational

    Barcode recognition libs are not downloaded and are not operational

    E/BarcodeNativeHandle: Error creating remote native handle com.google.android.gms.dynamite.DynamiteModule$zzc: No acceptable module found. Local version is 0 and remote version is 0.

    ...

    E/QREader: Barcode recognition libs are not downloaded and are not operational

    A week ago it worked correctly, but now it throws me that error. I have updated Play services and even then it is not possible to open the scanner

    Library works fine in Huawei P20 and Moto G6 Play

    • Device Information: Moto E5 Play

    • Android Version: 8.1.0

    bug 
    opened by RobertoLayna 7
  • Restart qreader?

    Restart qreader?

    Hello there, thanks for this great QR reader!

    I wonder if its possible to restart the qreader object after call .stop() on it.

    For example: On the onDetect listener, after I detect something, I show a Dialog and call qreader.stop()

    qrEader = new QREader.Builder(this, surfaceView, new QRDataListener() {
                @Override public void onDetected(final String data) {
                    Log.d("QREader", "Value : " + data);
                    surfaceView.post(new Runnable() {
                        @Override public void run() {
                            showDialog(data);
                        }
                    });
                qrEader.stop();               <------------------------------------- HERE
                }
            }).build();
    
            qrEader.init();
    

    So when I dismiss my Dialog I call qreader.start() but it doens't read the qrcode anymore

        private void showDialog(String qrcode) {
            AlertDialog.Builder builder = new AlertDialog.Builder(MainActivity.this);
            builder.setTitle("Confirmar convidado?");
            builder.setMessage(qrcode);
    
            String positiveText = getString(android.R.string.ok);
            builder.setPositiveButton(positiveText,
                    new DialogInterface.OnClickListener() {
                        @Override
                        public void onClick(DialogInterface dialog, int which) {
                            System.out.println("OK");
                            surfaceView.post(new Runnable() {
                                @Override public void run() {
                                    qrEader.start();      <------------------------- HERE
                                }
                            });
    
                        }
                    });
    
            String negativeText = getString(android.R.string.cancel);
            builder.setNegativeButton(negativeText,
                    new DialogInterface.OnClickListener() {
                        @Override
                        public void onClick(DialogInterface dialog, int which) {
                            System.out.println("CANCEL");
    
                            qrEader.start();       <-------------------------------- HERE
                        }
                    });
    
            AlertDialog dialog = builder.create();
    
            dialog.show();
        }
    
    opened by KalebPortillo 7
  • Problem access camera in marshmallow

    Problem access camera in marshmallow

    Hai Mate..

    Thanks for your qreader that help me so much in my apps,

    my apps works fine in my device with Android 5.0 Lolipop, but I have problem when I test it in Android 6.0 Marshmallow, my apps cannot access the camera, the surface view only display a blank black screen, I already try update my SDK platform to Android 8.0 Oreo and update my JDK to JDK8, but still don't resolve the problem,

    I hope you can help me, maybe it's my mistake, I really appreciate your effort and everything you have done,

    Best Regards and Thanks a lot..

    Attachment : 77c6c6b0-9002-4488-9bf9-b6549bef8f61

    opened by kasfulanwar 6
  • 📖 Guest Book 🙇🏻‍♂️

    📖 Guest Book 🙇🏻‍♂️

    This "issue" serves as a guest book. You're welcome to write nice things about this project, share how it's helped you out, learn something or solve a problem.

    Idea came from this tweet.

    opened by nisrulz 0
  • Migrate to Maven Central

    Migrate to Maven Central

    JFrog just announced that they'll be shutting down JCenter: https://jfrog.com/blog/into-the-sunset-bintray-jcenter-gocenter-and-chartcenter/

    Key dates are:

    February 28th: No more submissions will be accepted to Bintray, JCenter May 1st: Bintray, JCenter services will no longer be available

    Hence need to migrate to another maven repository like Maven central.

    enhancement 
    opened by nisrulz 1
  • Surface View stops camera preview

    Surface View stops camera preview

    Do you want to request a feature or report a bug?

    What is the current behavior?

    Surface View doesn't show camera preview (Or camera stops) when user locks the device and resume the activity again and this generally happens when u lock your device. Here the part of log:

    CAMERA_MSG_STATE_CALLBACK mCameraStateCallback is null Camera-JNI: copyAndPost: off=0, size=518400 msg=10 Camera-JNI: copyAndPost: off=0, size=518400 msg=10 Camera-JNI: copyAndPost: off=0, size=518400 msg=10

    Any other comments?

    I am performing these operations in onPause and onDestroy: @Override protected void onPause() { if (null != qrEader) { qrEader.stop(); } super.onPause(); }

    @Override
    protected void onDestroy() {
        super.onDestroy();
        if (null != qrEader) {
            qrEader.releaseAndCleanup();
        }
    }
    

    and restrating qrReader in onResume: qrEader.start();

    Device Information: one plus 5 Android Version: android oreo

    I also found out this in my log: W/DynamiteModule: Local module descriptor class for com.google.android.gms.vision.dynamite not found. W/zygote64: Unsupported class loader W/zygote64: Skipping duplicate class check due to unsupported classloader I/DynamiteModule: Considering local module com.google.android.gms.vision.dynamite:0 and remote module com.google.android.gms.vision.dynamite:1702

    Skipping duplicate class check due to unsupported classloader I/Vision: Loading library libbarhopper.so I/zygote64: The ClassLoaderContext is a special shared library. The ClassLoaderContext is a special shared library. Access denied finding property "camera.hal1.packagelist"

    bug 
    opened by rohitsharma181589 1
  • java.lang.IllegalStateException: Camera already started!

    java.lang.IllegalStateException: Camera already started!

    E/AndroidRuntime: FATAL EXCEPTION: main Process: com.shanky.qrscanner, PID: 8249 java.lang.IllegalStateException: Camera already started! at github.nisrulz.qreader.QREader.startCameraView(QREader.java:213) at github.nisrulz.qreader.QREader.start(QREader.java:176) at github.nisrulz.qreader.QREader$2.onGlobalLayout(QREader.java:118) at android.view.ViewTreeObserver.dispatchOnGlobalLayout(ViewTreeObserver.java:981) at android.view.ViewRootImpl.performTraversals(ViewRootImpl.java:2414) at android.view.ViewRootImpl.doTraversal(ViewRootImpl.java:1522) at android.view.ViewRootImpl$TraversalRunnable.run(ViewRootImpl.java:7098) at android.view.Choreographer$CallbackRecord.run(Choreographer.java:927) at android.view.Choreographer.doCallbacks(Choreographer.java:702) at android.view.Choreographer.doFrame(Choreographer.java:638) at android.view.Choreographer$FrameDisplayEventReceiver.run(Choreographer.java:913) at android.os.Handler.handleCallback(Handler.java:751) at android.os.Handler.dispatchMessage(Handler.java:95) at android.os.Looper.loop(Looper.java:154) at android.app.ActivityThread.main(ActivityThread.java:6682) at java.lang.reflect.Method.invoke(Native Method) at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:1520) at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1410)

    This happens when application goes in paused state while scanning qr code and just resume the application it will crash

    This is the code for paused state and resume state

    @Override protected void onPause() { super.onPause();

        if (hasCameraPermission) {
    
            // Cleanup in onPause()
            // --------------------
            qrEader.releaseAndCleanup();
        }
    }
    
    @Override
    protected void onResume() {
        super.onResume();
    
        if (hasCameraPermission) {
    
            // Init and Start with SurfaceView
            // -------------------------------
            qrEader.initAndStart(mySurfaceView);
    
        }
    }
    
    bug 
    opened by lakshyapunhani 3
  • Bug : Fail to connect to camera service - With explanation, steps to reproduce and possible fix

    Bug : Fail to connect to camera service - With explanation, steps to reproduce and possible fix

    Hi. I had the RuntimeException: Fail to connect to camera service. Log:

    java.lang.RuntimeException: Fail to connect to camera service
        at android.hardware.Camera.<init>(Camera.java:545)
        at android.hardware.Camera.open(Camera.java:385)
        at com.google.android.gms.vision.CameraSource.zzbjo(Unknown Source)
        at com.google.android.gms.vision.CameraSource.start(Unknown Source)
        at github.nisrulz.qreader.QREader.startCameraView(QREader.java:221)
        at github.nisrulz.qreader.QREader.access$400(QREader.java:40)
        at github.nisrulz.qreader.QREader$1.surfaceCreated(QREader.java:68)
        at android.view.SurfaceView.updateWindow(SurfaceView.java:607)
        at android.view.SurfaceView.onWindowVisibilityChanged(SurfaceView.java:246)
        at android.view.View.dispatchWindowVisibilityChanged(View.java:9322)
        at android.view.ViewGroup.dispatchWindowVisibilityChanged(ViewGroup.java:1285)
        at android.view.ViewGroup.dispatchWindowVisibilityChanged(ViewGroup.java:1285)
        at android.view.ViewGroup.dispatchWindowVisibilityChanged(ViewGroup.java:1285)
        at android.view.ViewGroup.dispatchWindowVisibilityChanged(ViewGroup.java:1285)
        at android.view.ViewGroup.dispatchWindowVisibilityChanged(ViewGroup.java:1285)
        at android.view.ViewGroup.dispatchWindowVisibilityChanged(ViewGroup.java:1285)
        at android.view.ViewGroup.dispatchWindowVisibilityChanged(ViewGroup.java:1285)
        at android.view.ViewGroup.dispatchWindowVisibilityChanged(ViewGroup.java:1285)
        at android.view.ViewGroup.dispatchWindowVisibilityChanged(ViewGroup.java:1285)
        at android.view.ViewGroup.dispatchWindowVisibilityChanged(ViewGroup.java:1285)
        at android.view.ViewRootImpl.performTraversals(ViewRootImpl.java:1468)
        at android.view.ViewRootImpl.doTraversal(ViewRootImpl.java:1191)
        at android.view.ViewRootImpl$TraversalRunnable.run(ViewRootImpl.java:6642)
        at android.view.Choreographer$CallbackRecord.run(Choreographer.java:777)
        at android.view.Choreographer.doCallbacks(Choreographer.java:590)
        at android.view.Choreographer.doFrame(Choreographer.java:560)
        at android.view.Choreographer$FrameDisplayEventReceiver.run(Choreographer.java:763)
        at android.os.Handler.handleCallback(Handler.java:739)
        at android.os.Handler.dispatchMessage(Handler.java:95)
        at android.os.Looper.loop(Looper.java:145)
        at android.app.ActivityThread.main(ActivityThread.java:5951)
        at java.lang.reflect.Method.invoke(Native Method)
        at java.lang.reflect.Method.invoke(Method.java:372)
        at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:1400)
    

    This is due to the camera being used from another app and not be released when the app goes to background.

    I can give the steps to reproduce this issue if you need.

    This exception is thrown in QREader.java in line 221, and is not caught by the IOException beacause it's a RunTimeException and we can't catch it because it's thrown in a background thread when surface is created.

    So to just fix the crash just change the IOException for just an Exception.

    Although this resolves the issue i think it's important to send feedback to the user and just catch the exception and print the error we cant do that. I think it would be useful some sort of listener so we could know the errors when the camera fails.

    Please if you could change this as soon as possible would be very helpful. And if you need any help just ask.

    bug 
    opened by LainCoubrt 2
Releases(2.1.1)
  • 2.1.1(Aug 29, 2017)

    Changelog

    • android gradle plugin to v3.0.0-beta3
    • android-maven-gradle-plugin to v2.0
    • lib version to v2.1.1-11
    • added requirement on Google Play Services line in readme
    • updated usage info in readme
    • replaced publish block with common config file
    • replaced compile with implementation as per gradle 4.1 update
    Source code(tar.gz)
    Source code(zip)
  • 2.1.0(Aug 22, 2017)

    Changelog

    • Removed support for devices running api < 14
    • added support for api 26 (Android O)
    • updated google play service dependency
    • updated support lib
    • added runtime permission check to sample app.

    This version only updates everything. Future versions would follow the usual cycle of bug fixes and feature additions.

    Source code(tar.gz)
    Source code(zip)
  • 2.0.0(Nov 28, 2016)

    Changelog

    • updated the underlying google vision dependency to v10.0.0
    • cleaned up the api
    • fixed issues with QREader not reading qr codes when device is locked and then unlocked.
    • couple of more smaller tweaks
    Source code(tar.gz)
    Source code(zip)
  • 1.0.6(Jun 1, 2016)

  • 1.0.5(May 23, 2016)

  • 1.0.4(May 18, 2016)

    Changelog

    • Fixes issue with camera freeze on device lock-unlock
    • Added feature detection and permission check for camera
    • Fixed the issue with setting processor
    Source code(tar.gz)
    Source code(zip)
Owner
Nishant Srivastava
Software Engineer 👨🏻‍💻
Nishant Srivastava
Android app and Python library for turning mobile phone into a WebSocket-based, remotely controllable Barcode/QR code reader

Remote Barcode Reader suite Android app and Python library for turning mobile phone into a remotely controllable Barcode/QR code reader. It exposes a

Krystian Dużyński 3 Dec 6, 2022
a simple QRCode generation api for java built on top ZXING

QRGen: a simple QRCode generation api for java built on top ZXING Please consider sponsoring the work on QRGen Dependencies: ZXING: http://code.google

Ken Gullaksen 1.4k Dec 31, 2022
Generate Qr Code using ZXING with a logo if needed

QrGeneratorWithLogo Generate Qr Code using ZXING with a logo if needed Download the Helper file and use it 1- add zxing lib into your project implem

null 0 Mar 14, 2022
⭐️ Quick and easy QR Code scanning app created using Jetpack Compose. ☘️

QR-Code-Scanner Scan your QR codes easily and quickly. ⭐️ Google Play Store : Screenshots of the app : ?? Libraries Used in The Project : // Jetpa

Nisa Efendioğlu 12 Oct 8, 2022
Yet Another Video Player (or YAVP) is a Video Player for Android that is based on Googles ExoPlayer.

Yet Another Video Player Yet Another Video Player (or YAVP) is a Video Player for Android that is based on Googles ExoPlayer. Who Is YAVP For? First o

null 62 Dec 29, 2022
Secret Codes is an Open Source application that allows you to browse through hidden codes of your Android phone.

####Secret Codes is an Open Source application that allows you to browse through hidden codes of your Android phone. This application will scan throug

Simon Marquis 251 Jan 6, 2023
Android barcode scanner with ML-Kit vision api

MLBarcodeScanner A demo project to show how to implement barcode scanner using Google ML-Kit Vision api Supported barcode types 2D formats: QR Code, A

Mahdi Javaheri 5 Dec 26, 2022
A simple NoSQL client for Android. Meant as a document store using key/value pairs and some rudimentary querying. Useful for avoiding the hassle of SQL code.

SimpleNoSQL A simple NoSQL client for Android. If you ever wanted to just save some data but didn't really want to worry about where it was going to b

Colin Miller 389 Sep 25, 2022
A simple NoSQL client for Android. Meant as a document store using key/value pairs and some rudimentary querying. Useful for avoiding the hassle of SQL code.

SimpleNoSQL A simple NoSQL client for Android. If you ever wanted to just save some data but didn't really want to worry about where it was going to b

Colin Miller 389 Sep 25, 2022
Another-read-more-lib - Another read more library for android

another-read-more-lib ?? Another read more library. Add it in your root build.gr

Geovani Amaral 9 Nov 2, 2022
Self hosted read and to-read list book tracker

JELU Official documentation Like Jelu or find it useful ? Offer me a coffee ☕ Purpose This app main purpose is to track what you have read, what you a

null 181 Dec 28, 2022
This project created just for help developer who want to and ability of read VISA, UNION PAY, HUMO, ATTO and some other cards data read.

If you enjoy my content, please consider supporting what I do. Thank you. By me a Coffee To get a Git project into your build: Step 1. Add the JitPack

Fozilbek Imomov 1 Oct 15, 2022
A sample project of implementing Liveness Detection and Identity OCR on Android app using Kredibel Vision SDK

Vision Sample (Android) A sample project of implementing Liveness Detection and Identity OCR on Android app using Kredibel Vision SDK. You can checkou

null 10 Nov 27, 2022
Read and write Android/data files on Android 13 without root

Android 13 (Tiramisu API 33) Read and write /Android/data or /Android/obb not need root Android 13 read and write /Android/data or /Android/obb withou

FolderV 59 Jan 4, 2023
Google's ML-Kit-Vision demo (android) for pre encoded video.

Google's ML-Kit-Vision demo (android) for pre encoded video. Demos for camera preview and still image are also included. This project is actually extension of Google's own sample.

null 17 Dec 29, 2022
Android app for implementing vision transformer(computationally heavy) in production.

Android app for implementing vision transformer(computationally heavy) in production.

Mann Patel 3 Nov 14, 2022
This application uses Google Play Services Vision library to scan barcodes. It uses Google's on device ML kit to scan for barcodes.

Barcode-Scanner This application showcases use of Google Play Services Vision library It uses Google's on device machine learning kit to scan for barc

Soumik 2 Apr 28, 2022
A blogging mobile application built with Kotlin using MVC design pattern and Take some advantage of Jetpack , View & Data Binding It's a mimic for Tumblr application , But a little prettier than him 😉

A blogging mobile application built with Kotlin using MVC design pattern and Take some advantage of Jetpack , View & Data Binding It's a mimic for Tum

Ahmed Ihab 17 Dec 23, 2022
This repo provides a sample application that demonstrates how you can speed up the authentication experience for frontline workers on shared devices using QR codes.

Project This repo has been populated by an initial template to help get you started. Please make sure to update the content to build a great experienc

Microsoft 5 Dec 7, 2022
Send Whatsapp Message Without Saving Mobile Number

Send Whatsapp Message Without Saving Mobile Number In this project i created the

THANGADURAI SELVARAJ 2 Apr 22, 2022