Android Utililty Methods Camera Set

List of utility methods to do Camera Set

Description

The list of methods to do Camera Set are organized into topic(s).

Method

voidsetVideoStabilization(Camera.Parameters parameters)
set Video Stabilization
if (parameters.isVideoStabilizationSupported()) {
    if (parameters.getVideoStabilization()) {
        Log.i(TAG, "Video stabilization already enabled");
    } else {
        Log.i(TAG, "Enabling video stabilization...");
        parameters.setVideoStabilization(true);
} else {
...
voidsetZoom(Camera.Parameters parameters, double targetZoomRatio)
set Zoom
if (parameters.isZoomSupported()) {
    Integer zoom = indexOfClosestZoom(parameters, targetZoomRatio);
    if (zoom == null) {
        return;
    if (parameters.getZoom() == zoom) {
        Log.i(TAG, "Zoom is already set to " + zoom);
    } else {
...
intgetBackId()
get Back Id
int numberOfCameras = Camera.getNumberOfCameras();
CameraInfo cameraInfo = new CameraInfo();
for (int i = 0; i < numberOfCameras; i++) {
    Camera.getCameraInfo(i, cameraInfo);
    if (cameraInfo.facing == CameraInfo.CAMERA_FACING_BACK) {
        return i;
throw new Exception();
voidadjustCamera(Context context, Camera camera)
adjust Camera
if (context.getResources().getConfiguration().orientation != Configuration.ORIENTATION_LANDSCAPE) {
    camera.setDisplayOrientation(90);
} else {
    camera.setDisplayOrientation(0);