I am using Camera2
api of Android. I am able to capture image and save it. I am using autofocus
mode to focus and capture images.
captureBuilder.set(CaptureRequest.CONTROL_AF_MODE, CaptureRequest.CONTROL_AF_MODE_CONTINUOUS_PICTURE);
where captureBuilder is
private CaptureRequest.Builder captureBuilder;
I want to show a rectangle or circle in the autofocus area in the camera preview as it happens in the default camera application. For an instance like the rectangle in the middle of the preview here.
I have seen this but I do not want anything on touching anywhere in the preview.
I have searched through a lot of examples but most of them illustrate use of deprecated Camera
class, nothing much useful on Camera2
api. How can this focus rectangle can this be achieved with the new camera api?