Open tobrun opened 9 years ago
This may be a camera focus issue -- some of the barcode formats work better when the camera is fully in focus.
Is your app using CameraSource? As discussed in another thread, this initial release does not have an auto camera focus option on CameraSource, but this will be added in a future release. In the meantime, you might try the workaround suggested by Aeefire in this thread:
I don't see the EAN_13
barcode as supported. Maybe that's why? Is it intended?
For 1D Bar Codes, these are: AN-13 EAN-8 UPC-A UPC-E Code-39 Code-93 Code-128 ITF Codabar
Source: http://android-developers.blogspot.co.uk/2015/08/barcode-detection-in-google-play.html
Update1: I tried myself and EAN_13
works, but yeah sometimes (specially when it's too close) because of the focus issue it's hard to read.
Update2: Nvm it's listed here as supported: https://developers.google.com/vision/barcodes-overview
We have recently open sourced the CameraSource class:
This version includes an auto-focus option, which will probably help.
I am new in android .i have try QR_Code sample it is working fine . When I try to scan an EAN_13 barcode it is not working.i add this line in new BarcodeDetector.Builder(context).setBarcodeFormats(Barcode.EAN_13).build(); i Check this link but i an not able to understand this code .can anyone help me how i add this code in my sample code. https://github.com/googlesamples/android-vision/blob/master/visionSamples/barcode-reader/app/src/main/java/com/google/android/gms/samples/vision/barcodereader/ui/camera/CameraSource.java
If you are using CameraSource, you'd enable focus mode by calling this builder method:
While trying out the sample code:
When I try to scan an EAN_13 barcode:
Also I tried to configure a specific barcode variant, but this resulted in same behaviour: