Here you can find the source of checkCameraHardware(Context context)
public static boolean checkCameraHardware(Context context)
//package com.java2s; import android.content.Context; import android.content.pm.PackageManager; public class Main { /**/* w w w . java2 s . c om*/ * Check if this device has a camera */ public static boolean checkCameraHardware(Context context) { if (context.getPackageManager().hasSystemFeature( PackageManager.FEATURE_CAMERA)) { // this device has a camera return true; } else { // no camera on this device return false; } } }