To do that you first need to get a list of supported image sizes. The method
Camera.Parameters.getSupportedPictureSizes( documented here) can help us with this task. The returned value is a list of picure sizes which (among other things) contains the width and height of the supported picture size. With some simple math we can get the number of Megapixels supported by the camera.
So less talk more code
public ListThe returned list will contain values like 2 5 7 ... meaning that the camera supports pictures of size 2 5 and 7 megapixels.getAllSupportedMegapixelsByCamera(int cameraID){ List mpList=new ArrayList (); Camera myCamera=Camera.open(cameraID) ; // use Camera.open() for the default back facing camera or if you're supporting an older sdk version. // make sure the camera is not in use or something. if(myCamera!=null){ Camera.Parameters allParams=myCamera.getParameters(); for(Camera.Size pictureSize: allParams.getSupportedPictureSizes ()){ int sizeInMegapixel=Math.round((pictureSize.width*pictureSize.height)/1000000); mpList.add(sizeInMegapixel); } } return mpList; }