saw this on developer.android.com :
If you want to set a specific size for the camera preview, set this in the surfaceChanged () method, as noted in the comments above. when setting the preview size, you should use the values ββfrom getSupportedPreviewSizes (). Do not set arbitrary values ββin setPreviewSize ().
and wrote this to get the smallest value:
List<Size> list = mCamera.getParameters().getSupportedPictureSizes(); Size size = list.get(0); int height = size.height; int minHeight=9999999; for(int i = 0; i<=list.size(); i++){ if(list.get(i).height<minHeight){ minHeight = list.get(i).height; } }
hope it works!
source share