Hello guys, this time I want to share my experience in creating an ID card scanning feature on an Android device. Incidentally, I have successfully accessed the camera and I adjusted it to a custom layout design for framing the ID card, but a new problem arose, I couldn't get a clear picture when the camera was brought closer so that the ID card entered the frame.
I want to autofocus the Android camera as soon as the camera is still. I'm looking for a tutorial or example of how to do it or at least a small example that shows what class I can use to attend such an event.
Solution
//set camera to continuous auto-focus Camera.Parameters params = c.getParameters(); //*EDIT*//params.setFocusMode("continuous-picture"); //It is better to use defined constraints as opposed to String, thanks to AbdelHady params.setFocusMode(Camera.Parameters.FOCUS_MODE_CONTINUOUS_PICTURE); c.setParameters(params);