QRCodeReaderView
QRCodeReaderView copied to clipboard
It takes a long time for the very first scan result
I tried this on few phones, Galaxy S8, Android 7.0, Nexus 5, Android 6.0.1. If I launch the app for the first time after swipe kill. It takes a longer time to get the onQRCodeRead callback(sometimes could be more than 1 minute). The QRCodeReaderView is inside a Relative layout. My code has similar structure as the sample. Part of the activity is like following.
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_custom_scanner);
qrCodeReaderView = (QRCodeReaderView) findViewById(R.id.qr_decoder_view);
qrCodeReaderView.setOnQRCodeReadListener(this);
qrCodeReaderView.setQRDecodingEnabled(true);
qrCodeReaderView.setBackCamera();
}
@Override
public void onResume() {
super.onResume();
qrCodeReaderView.startCamera();
}
@Override
public void onPause() {
super.onPause();
qrCodeReaderView.stopCamera();
}
@Override
public void onQRCodeRead(String text, PointF[] points) {
qrCodeReaderView.setQRDecodingEnabled(false);
DataCollectorLogger.logInfo("Scanned QR code content: " + text);
}
I am experiencing the same problem. What's the issue here? Were you able to solve it?
It sometimes takes forever to read a QR code.
I turned to Google API: https://developers.google.com/android/reference/com/google/android/gms/vision/barcode/BarcodeDetector