Here you can find the source of hasFlash(Camera mCamera)
public static boolean hasFlash(Camera mCamera)
//package com.java2s; //License from project: Open Source License import android.hardware.Camera; import java.util.List; public class Main { /**//from w w w. jav a2s . c om * Check if this device has flash */ public static boolean hasFlash(Camera mCamera) { if (mCamera == null) { return false; } Camera.Parameters parameters = mCamera.getParameters(); if (parameters.getFlashMode() == null) { return false; } List<String> supportedFlashModes = parameters .getSupportedFlashModes(); if (supportedFlashModes == null || supportedFlashModes.isEmpty() || supportedFlashModes.size() == 1 && supportedFlashModes.get(0).equals( Camera.Parameters.FLASH_MODE_OFF)) { return false; } return true; } }