Closed HackeCode closed 3 years ago
It also interests me
The camera is selected in CodeReaderFragment.kt:95 when calling: binding.barcodeScanner.initializeFromIntent(requireActivity().intent)
A quick and dirty solution is to write in Firstactivity.tk:164:
intent.putExtra(Intents.Scan.CAMERA_ID,1);
Instead of 1 you have to get the camera id of your front camera, there are several ways to do that: for instance you can use a button to toggle between a list of available ids.
I use this code:
private fun openQrCodeReader() { val intent = Intent(this, MainActivity::class.java) intent.putExtra(Intents.Scan.CAMERA_ID,1); startActivity(intent) }
But not work Frontal Camera
@EdossProject try the code provided by @zubeer95.
I'll close this issue cause it's not strictly related to the final app, it will be forced to use back camera for certificates scanning.
Hi, how ca we use front camera? there is a way?