Android examples for android.hardware:Camera Preview
Returns a list of available camera preview sizes
import android.graphics.Bitmap; import android.hardware.Camera; import java.lang.reflect.Method; import java.util.Collections; import java.util.List; public class Main{ /** Returns a list of available camera preview sizes, or null if the Android API to get the sizes is not available. *//*from w w w.ja v a2 s .com*/ public static List<Camera.Size> previewSizesForCameraParameters( Camera.Parameters params) { try { Method m = params.getClass().getMethod( "getSupportedPreviewSizes"); return (List<Camera.Size>) m.invoke(params); } catch (Exception ex) { return null; } } }