Force camera resolution for Android

In my Android application, I would like to limit the maximum resolution (or size in mb) of the picture taken.

Here is what I call camera activity:

Intent intent = new Intent( MediaStore.ACTION_IMAGE_CAPTURE ); intent.putExtra( MediaStore.EXTRA_OUTPUT, Uri.fromFile( new File( mTmpFilePath ) ) ); intent.putExtra( "filename", mTmpFilePath ); startActivityForResult( intent, REQUEST_CAMERA ); 

Is there a way to force or limit the resolution of the camera?

+4
source share
1 answer

If you run the camera application with the intention, you are depending on this goodwill application. (some of them will support this, and some will not). You can try to adjust the image resolution using the camera class, but I found that not all advertised sizes are supported, some are ignored, and some produce errors - camera applications behave differently on different devices.

+1
source

All Articles