Is flash Light Available - Android android.hardware

Android examples for android.hardware:Flash

Description

Is flash Light Available

Demo Code

import android.annotation.SuppressLint;
import android.content.Context;
import android.content.pm.PackageManager;
import android.hardware.Camera;
import android.hardware.Camera;

public class Main{

    public static boolean flashLightAvailable(Context context) {
        boolean available = false;
        do {//from   ww w  .  j  a  va 2 s  .  com
            if (null == context) {
                break;
            }

            available = context.getPackageManager().hasSystemFeature(
                    PackageManager.FEATURE_CAMERA_FLASH);
        } while (false);
        return available;
    }

}

Related Tutorials