Android examples for Camera:Camera Size
set Camera Picture Size
//package com.java2s; import java.util.List; import android.hardware.Camera.Parameters; import android.hardware.Camera.Size; public class Main { public static boolean setCameraPictureSize(String candidate, List<Size> supported, Parameters parameters) { int index = candidate.indexOf('x'); if (index == -1) return false; int width = Integer.parseInt(candidate.substring(0, index)); int height = Integer.parseInt(candidate.substring(index + 1)); for (Size size : supported) { if (size.width == width && size.height == height) { parameters.setPictureSize(width, height); return true; }//from w ww .j a v a 2 s. c o m } return false; } }