is Torch Flash Mode - Android Camera

Android examples for Camera:Camera Flash

Description

is Torch Flash Mode

Demo Code


//package com.java2s;
import android.hardware.Camera;
import android.hardware.Camera.Parameters;

public class Main {
    private static Camera camera = null;

    public static boolean isTorchFlashMode() {
        boolean b = false;
        checkCamera();/*  ww  w .j  a  v  a 2  s.  co  m*/
        if (camera == null)
            return b;
        final Parameters param = camera.getParameters();
        if (param.getFlashMode().equals(Camera.Parameters.FLASH_MODE_TORCH)) {
            b = true;
        }
        return b;
    }

    private static void checkCamera() {
        if (camera == null)
            camera = Camera.open();
    }
}

Related Tutorials