Change camera resolution setting programmatically in android

I use the code below to open the camera. Is it possible to set the camera resolution to a high level programmatically?

private void openDefaultCameraApp() {
    Intent i = new Intent(android.provider.MediaStore.ACTION_IMAGE_CAPTURE);
    startActivityForResult(i, CAPTURE_PHOTO_CONSTANT);
}
+5
source share
3 answers

You must add MediaStore.EXTRA_OUTPUTto the intention. In addition, you must specify the Uri for the image to be saved. This will save the full resolution image, otherwise it will simply close the small image.

Refer to Android docs : ACTION_IMAGE_CAPTURE

Intent, , . EXTRA_OUTPUT , . EXTRA_OUTPUT , Bitmap . , . EXTRA_OUTPUT, Uri EXTRA_OUTPUT

+2
+2

You can use this method to get all supported image sizes.

public List<Camera.Size> getSupportedPictureSizes ()

You will get Listsupported image sizes. And then from this you can set any size you want to use this method.

public void setPictureSize (int width, int height)
+1
source

All Articles