Android examples for android.hardware:Flash
Is flash Light Available
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; } }