I am making a custom camera app, and I am using the Android Camera API for that. I know this API is deprecated now and it is recommended to use the Camera2 API. But I have to only preview the camera with some zoom.
Below is the code for setting the zoom
Camera.Parameters parameters = camera.getParameters();
parameters.setZoom(30);
parameters.setPreviewFpsRange(
previewFpsRange[Camera.Parameters.PREVIEW_FPS_MIN_INDEX],
previewFpsRange[Camera.Parameters.PREVIEW_FPS_MAX_INDEX]);
parameters.setPreviewFormat(IMAGE_FORMAT);
camera.setParameters(parameters);
Now, the problem is that the camera zoom is not equal across devices, some devices zoom in to a good amount whereas some devices zoom very much.
I am not able to find any explanation over the internet regarding the same.
I need the same zoom level across all the Android devices irrespective of the camera quality and MP.