Android examples for Camera:Camera Focus
set Camera Focus Area
import java.util.Arrays; import java.util.Collection; import java.util.Collections; import java.util.Iterator; import java.util.List; import android.graphics.Rect; import android.hardware.Camera; public class Main { private static final String TAG = ""; private static final int AREA_PER_1000 = 400; public static void setFocusArea(Camera.Parameters parameters) { if (parameters.getMaxNumFocusAreas() > 0) { List<Camera.Area> middleArea = buildMiddleArea(AREA_PER_1000); parameters.setFocusAreas(middleArea); }//from w w w.j av a 2 s. co m } private static List<Camera.Area> buildMiddleArea(int areaPer1000) { return Collections .singletonList(new Camera.Area(new Rect(-areaPer1000, -areaPer1000, areaPer1000, areaPer1000), 1)); } }