Java tutorial
//package com.java2s; //License from project: Open Source License import java.util.List; import android.hardware.Camera; import android.hardware.Camera.Size; public class Main { public static Camera.Size getHighestResolution(Camera c) { List<Camera.Size> sizes = c.getParameters().getSupportedPictureSizes(); Camera.Size size = null; int maxres = 0; for (Size s : sizes) { if (s.width * s.height > maxres) { maxres = s.width * s.height; size = s; } } return size; } }