QRCodeReaderView icon indicating copy to clipboard operation
QRCodeReaderView copied to clipboard

It takes a long time for the very first scan result

Open zengziwei789 opened this issue 7 years ago • 2 comments

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);
}

zengziwei789 avatar Jan 25 '18 20:01 zengziwei789

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.

Marco77577 avatar Jan 30 '19 15:01 Marco77577

I turned to Google API: https://developers.google.com/android/reference/com/google/android/gms/vision/barcode/BarcodeDetector

zengziwei789 avatar Mar 12 '19 23:03 zengziwei789