Android examples for Camera:Camera Preview
Returns a list of available camera preview sizes, or null if the Android API to get the sizes is not available.
//package com.java2s; import java.lang.reflect.Method; import java.util.List; import android.hardware.Camera; 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 www .ja v a 2s. co m*/ 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; } } }