Search code examples
javaandroidcameraandroid-implicit-intent

open camera with picture size as 16:9 programatically


i am developing an image editing app, when the camera is invoked i can able to change the picture size as 16:9 manually, is it possible to open the camera by setting the picture size as 16:9 programatically.

the code below invokes the camera

Intent intent = new Intent(MediaStore.ACTION_IMAGE_CAPTURE);
intent.setFlags(Intent.FLAG_GRANT_READ_URI_PERMISSION|Intent.FLAG_GRANT_WRITE_URI_PERMISSION);
intent.putExtra(MediaStore.EXTRA_OUTPUT, imgUri);
startActivityForResult(intent, REQUEST_CAMERA);

Solution

  • is it possible to open the camera by setting the picture size as 16:9 programatically

    No.

    There is no requirement for the camera hardware on a device to support 16:9.

    Even for those devices that support such a resolution, there is no requirement for a camera app to support 16:9.

    Even for those camera apps that support such a resolution, there is no standard means to request this via ACTION_IMAGE_CAPTURE.