Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Stops the reader of the handheld terminal. #747

Open
hasanozn opened this issue Feb 1, 2024 · 4 comments
Open

Stops the reader of the handheld terminal. #747

hasanozn opened this issue Feb 1, 2024 · 4 comments

Comments

@hasanozn
Copy link

hasanozn commented Feb 1, 2024

Description of the problem:

When I read the zxing barcode via the handheld terminal, it reads it on the terminal's camera, but it stops the terminal's own scanner.

Which library version are you using? E.g. 3.2.0.
3.2.0
Which phone/tablet are you using, and which Android version does it run? (e.g. Samsung Galaxy S5,
Android 5.0)

Android 11 Hyatta Model 5 Handheld Terminal

Does the same happen on other devices or an emulator?

Yes that happens all handheld terminals.

Can you reproduce the issue in the sample project included with the library? If not, can you
provide your own sample project or sample code that produces this error?

fun Fragment.showBarcodeDialog(
result: (barcodeText: String) -> Unit = {}
) {
showDialog(object : ViewConvertListener {
override fun provideViewBinding(
inflater: LayoutInflater,
container: ViewGroup?
): DialogStockMngScanBarcodeBinding {
return DialogStockMngScanBarcodeBinding.inflate(inflater, container, false)
}
override fun convertView(
vb: DialogStockMngScanBarcodeBinding,
dialog: BaseMyDialog
) {

        val formats: Collection<BarcodeFormat> = listOf(BarcodeFormat.QR_CODE, BarcodeFormat.CODE_39,BarcodeFormat.CODE_128, BarcodeFormat.EAN_13, BarcodeFormat.DATA_MATRIX)
        vb.barcodeView.barcodeView.decoderFactory = DefaultDecoderFactory(formats)
        vb.barcodeView.initializeFromIntent(requireActivity().intent)
        vb.barcodeView.decodeContinuous(object : BarcodeCallback {
            override fun barcodeResult(br: BarcodeResult?) {
                br?.text?.let {
                    result(it)
                }
                vb.barcodeView.pause()

                dialog.dismiss()
            }

            override fun possibleResultPoints(resultPoints: MutableList<ResultPoint>?) {
            }
        })
        vb.barcodeView.resume()

        vb.swFlashlight.setOnCheckedChangeListener { _, checked ->
            if (checked) vb.barcodeView.setTorchOn() else vb.barcodeView.setTorchOff()
        }
    }
})

}

In the case of an error do you have a stack trace or adb logs?
No that not gives logs.

@rkistner
Copy link
Member

rkistner commented Feb 1, 2024

That sounds like a device issue rather than an issue with this library.

Does the scanner continue working when using other camera or barcode scanning apps?

@hasanozn
Copy link
Author

hasanozn commented Feb 1, 2024

I tried it on another handheld terminal and the result is the same.

@rkistner
Copy link
Member

rkistner commented Feb 1, 2024

I mean the device model, not the specific device.

We don't interact with the terminal's own scanner at all, so it is most likely something in the terminal itself that deactivates the scanner when the camera is used.

@hasanozn
Copy link
Author

hasanozn commented Feb 1, 2024

By the way, when I delete the barcodeview.resume line, there is no problem.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants