Determining Camera Resolution (i.e. Megapixels) Programmatically in Android

YuDroid picture YuDroid · Aug 5, 2011 · Viewed 45.4k times · Source

I am developing an Android application in 2.2, which uses Camera. Now Can anyone tell me that "Is it possible to programmatically determine the Camera Resolution in Megapixels in Android"

Answer

wAroXxX picture wAroXxX · Aug 5, 2011

if you've got the camera object, try:

android.hardware.Camera.Parameters parameters = camera.getParameters();
android.hardware.Camera.Size size = parameters.getPictureSize();


int height = size.height;
int width = size.width;