Java tutorial
//package com.java2s; //License from project: Open Source License import android.content.Context; import android.content.pm.PackageManager; import android.util.Log; public class Main { private static String TAG = "com.example.asm.CameraUtils"; /** Check if this device has a camera */ private 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 Log.d(TAG, "no camera on this device"); return false; } } }