Search code examples
javaandroidqr-codereader

Android QrCode scan with preview, no Intent


I'm creating a qrcode scanner android app, and for this i used a lib called zbar. This nice lib provide me a preview in a view I give it to him (like a relativeLayout).

If it detect qrcode, I can received a string with the content of the qrcode.

That was before i tried to integrate the new android design libs with navigationView :

  • com.android.support:design:23.0.0
  • com.android.support:appcompat-v7:23.0.0

The probleme is : that zbar are using Android.Camera and this don't work with sdk 23 and the android design don't work without sdk 23.

I tried this : ZBAR barcode scanning library not working when using target sdk version 23 in gradle but this don't seem work with me.

So I decided to change for another scanner lib : https://github.com/tschaumburg/FastBarcodeScanner

But this dosen't work too. The demo app crashed, and after I tried to repair the lib myself by searching a lot, I can scan but i have no preview.

One more thing, must i managed Android.Camera and Android.Camera2 or can i only use Android.Camera ?

So, it exist a android lib that can manage this with android design ?


Solution

  • ...

    I just forgot to add zbar as a library.

    It work well now.