I tried Google barcode-reader from https://github.com/googlesamples/android-vision
This example doesn't work. When I tab to screen it always detect
"no barcode detected"
Debug reason :
private boolean onTap(float rawX, float rawY) {
//TODO: use the tap position to select the barcode.
BarcodeGraphic graphic = mGraphicOverlay.getFirstGraphic();
Barcode barcode = null;
if (graphic != null) {
barcode = graphic.getBarcode();
if (barcode != null) {
Intent data = new Intent();
data.putExtra(BarcodeObject, barcode);
setResult(CommonStatusCodes.SUCCESS, data);
finish();
}
else {
Log.d(TAG, "barcode data is null");
}
}
else {
Log.d(TAG,"no barcode detected");
}
return barcode != null;
}
graphic
variable is always Null
See the image:
Anyone faced this problem? Can you let me know how to resolve it? Thank you so much!
If your Android device is not scanning a QR code, make sure the code is properly framed on your screen. Cleaning your camera lens and getting better lighting on the code are other potential solutions. You can also try using Google Lens or a third-party QR code app.
If you're holding your phone too close or too far away, it won't scan the code. Try holding your phone about 30 cm (1 foot) away and slowly moving it towards the QR code. Some phone cameras can't focus as well as others close up, so you may have to hold your phone a bit further away.
Troubleshooting the Barcode Scanner You can try turning your mobile device off and back on. This will close any apps that were running in the background. Try accessing the barcode scanner again without any other apps open. You can also check to make sure camera permissions are granted for Lose It!.
So I guest you are new to Android Mobile Vision, in the new version of Google Play services (v9) they temporarily disabled the feature due to a serious bug in that feature, you can check the release note here:
https://developers.google.com/android/guides/releases#may_2016_-_v90
As @Vietnt134 have already answered, Android Mobile Vision is temporarily disabled.
You can follow this topic to know if something knew came up: https://github.com/googlesamples/android-vision/issues/98
People are pretty mad with Google about this. I hope they solve this quickly.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With