Search code examples
androidautofocusandroid-vision

Android: Library MaterialBarcodeScanner which uses Google Mobile Vision API does not autofocus for Samsung J1


MaterialBarcodeScanner which uses Google Mobile Vision API does not autofocus for Samsung J1 but when using Zxing library its working fine.Same code works for other higher version API (Tested onSamsung A5).

Im refering to link: https://github.com/EdwardvanRaak/MaterialBarcodeScanner

I went through many posts which suggests changing Camera.Parameters.FOCUS_MODE_CONTINUOUS_PICTURE to FOCUS_MODE_CONTINUOUS_VIDEO and FOCUS_MODE_AUTO. But Thats not working.

Please help. Not understanding what could be the reason for autofocus not to work.


Solution

  • If you don't succeed with this MaterialBarcodeScanner, try to use Google Vision samples provided by Google themselves:

    https://github.com/googlesamples/android-vision

    I just copied sample classes to my project, customized them a little acording to my needs. Auto-focus works perfectly well.