I'm currently using Zxing Embedded for QR code scanning in continuous mode. However, I'm encountering an issue where it scans randomly from various patterns, including clothes and other non-QR code elements. Has anyone else experienced this problem, and if so, could you please share any solutions or suggestions to fix this issue?
barcodeScannerView = findViewById(R.id.scanner_view);
Collection<BarcodeFormat> formats = Arrays.asList(BarcodeFormat.QR_CODE, BarcodeFormat.CODE_39);
barcodeScannerView.getBarcodeView().setDecoderFactory(new DefaultDecoderFactory(formats));
barcodeScannerView.initializeFromIntent(getIntent());
barcodeScannerView.setStatusText("");
beepManager = new BeepManager(this);
barcodeScannerView.setBackgroundColor(ContextCompat.getColor(this, R.color.white));
barcodeScannerView.decodeContinuous(callback);
CameraSettings cameraSettings = new CameraSettings();
cameraSettings.setFocusMode(CameraSettings.FocusMode.AUTO);
cameraSettings.setAutoTorchEnabled(false);
if (mSession.getIs_top_camera_enabled().equals("1")) {
cameraSettings.setRequestedCameraId(1); // or CAMERA_FRONT or specific camera id
} else {
cameraSettings.setRequestedCameraId(0); // or CAMERA_BACK or specific camera id
}
barcodeScannerView.setCameraSettings(cameraSettings);
Thank you in advance for your help! Gaurav Kapoor
After adding few changes in the following code issue is resolved.