Java tutorial
//package com.java2s; import android.content.*; import android.content.pm.*; public class Main { private static Boolean mHasFlash; public static boolean hasFlash(Context con) { if (mHasFlash != null) return mHasFlash; try { PackageManager pm = con.getPackageManager(); mHasFlash = pm.hasSystemFeature(PackageManager.FEATURE_CAMERA_FLASH); return mHasFlash; } catch (Throwable t) { mHasFlash = null; return false; } } }