Java tutorial
//package com.java2s; import android.content.Context; import android.content.pm.PackageManager; public class Main { /** * @param context * the application context * @return true if the device has a front camera, false else */ public static boolean hasCameraFront(Context context) { PackageManager pm = context.getPackageManager(); return pm.hasSystemFeature(PackageManager.FEATURE_CAMERA_FRONT); } }