Android examples for Camera:Camera Flash
Check if this device is supporting flashlight or not
//package com.java2s; import android.content.Context; import android.content.pm.PackageManager; import android.util.Log; public class Main { public static final String TAG = "CameraUtils"; public static boolean hasFlash; /**/*from w ww . j av a 2 s . c om*/ * Check if this device is supporting flashlight or not * * @param context * to access the Android resources * @return true if the device has flash support. */ public static boolean deviceHasFlash(Context context) { hasFlash = context.getPackageManager().hasSystemFeature( PackageManager.FEATURE_CAMERA_FLASH); if (!hasFlash) { Log.d(TAG, "Device does not has flash"); return false; } Log.d(TAG, "Device has flash"); return true; } }