The camera zoom is optical zoom, and the program only does post-processing. The system camera relies on the underlying driver, which can achieve more refined processing. The Camera API open at the application layer is not the entire camera control API, so there is a difference. In addition, the Camera API is not mobile related.
I have seen the source code of zxing (although it is very old code, it can still be used). It uses AsyncTask to continuously cycle focus. Although there are parameters for continuous focus in the API, it requires mobile phone support. After trying it, the effect is not very good. For reference only, please refer to it. https://github.com/zxing/zxing/blob/master/android/src/com/google/zxing/client/android/camera/AutoFocusManager.java
Attached is a demo of camera2 https://github.com/googlesamples/android-Camera2Basic
The camera zoom is optical zoom, and the program only does post-processing. The system camera relies on the underlying driver, which can achieve more refined processing. The Camera API open at the application layer is not the entire camera control API, so there is a difference. In addition, the Camera API is not mobile related.
I have seen the source code of zxing (although it is very old code, it can still be used). It uses AsyncTask to continuously cycle focus. Although there are parameters for continuous focus in the API, it requires mobile phone support. After trying it, the effect is not very good. For reference only, please refer to it.
https://github.com/zxing/zxing/blob/master/android/src/com/google/zxing/client/android/camera/AutoFocusManager.java
Attached is a demo of camera2
https://github.com/googlesamples/android-Camera2Basic