flutter_barcode_scanner icon indicating copy to clipboard operation
flutter_barcode_scanner copied to clipboard

Frame-Focusing Scanner on Android

Open Jayson1999 opened this issue 4 years ago • 8 comments

As the Google's API used in Android for barcode scanning only comes with whole-screen scanning. The UI of the barcode scanning shows a focus-frame in the center of the screen, thus indicating users that the barcode in the frame will be detected.

scanfocus

However, in the case like the above screenshot where multiple barcodes are shown in the screen, the barcode reader will have to pick between the 2 barcodes. Therefore, enhancement has been implemented with a sub-class to read only the barcode inside the frame by cropping accordingly to the frame's size. This can help to prevent constantly receiving wrong barcode in the Single-Scan mode where the Activity will close and return the result instantly upon detecting a barcode. The detection may always be too fast for user to be able to single-tap to select the targeted barcode or even try the zoom gesture, so I feel that the enhancement might be helpful in scenarios.

Hopefully this request can be reviewed and thank you for the time.

Jayson1999 avatar May 18 '21 15:05 Jayson1999

any updates on this one as this feature is needed

utsavDave97 avatar Dec 29 '21 19:12 utsavDave97

any updates on this one as this feature is needed

I think you can clone from my branch if you would like to use it.

Jayson1999 avatar Dec 30 '21 11:12 Jayson1999

any updates on this one as this feature is needed

I think you can clone from my branch if you would like to use it.

Thank you @Jayson1999 Appreciate it! I guess the owner of this repo is not active since last 6-7 months. God knows!!

utsavDave97 avatar Dec 30 '21 12:12 utsavDave97

any updates on this one as this feature is needed

I think you can clone from my branch if you would like to use it.

Hey @Jayson1999 So I got this error when I was building the project!

error: incompatible types: CentralDetector cannot be converted to BarcodeDetector
        CameraSource.Builder builder = new CameraSource.Builder(getApplicationContext(), centralDetector)

Please let me know.

utsavDave97 avatar Dec 30 '21 14:12 utsavDave97

Hey @Jayson1999 So I got this error when I was building the project!

error: incompatible types: CentralDetector cannot be converted to BarcodeDetector
        CameraSource.Builder builder = new CameraSource.Builder(getApplicationContext(), centralDetector)

Please let me know.

utsavDave97 avatar Jan 06 '22 09:01 utsavDave97

Hey @Jayson1999 So I got this error when I was building the project!

error: incompatible types: CentralDetector cannot be converted to BarcodeDetector
        CameraSource.Builder builder = new CameraSource.Builder(getApplicationContext(), centralDetector)

Please let me know.

Hi, might need some weekends to look into it. In the meantime, feel free to explore around it and share with me the good news if you have one!

Jayson1999 avatar Jan 06 '22 14:01 Jayson1999

Hey @Jayson1999 So I got this error when I was building the project!

error: incompatible types: CentralDetector cannot be converted to BarcodeDetector
        CameraSource.Builder builder = new CameraSource.Builder(getApplicationContext(), centralDetector)

Please let me know.

@utsavDave97 Tested mine was working well... Mind sharing your use case and the complete trace log?

Jayson1999 avatar Jan 06 '22 15:01 Jayson1999

Hey @Jayson1999 You could find my code here (https://github.com/utsavDave97/flutter_barcode_scanner/tree/master/android/src/main/java/com/amolg/flutterbarcodescanner)

utsavDave97 avatar Jan 06 '22 16:01 utsavDave97