set Camera Scene Mode - Android Camera

Android examples for Camera:Camera Attribute

Description

set Camera Scene Mode

Demo Code


//package com.java2s;
import java.util.List;
import android.hardware.Camera.Parameters;

public class Main {
    public static void setSceneMode(Parameters params, String value) {
        List<String> supported = params.getSupportedSceneModes();
        String supportedValue = getSupportedValue(supported, value);
        if (supportedValue == null) {
            return;
        }//from  w  ww .  ja  va 2 s.  c o m
        params.setSceneMode(supportedValue);
    }

    private static String getSupportedValue(List<String> supported,
            String value) {
        return (supported != null) && supported.contains(value) ? value
                : null;
    }
}

Related Tutorials