Here you can find the source of checkFrontCamera(Context context)
public static boolean checkFrontCamera(Context context)
//package com.java2s; //License from project: Open Source License import android.content.Context; import android.content.pm.PackageManager; public class Main { /**/*from w w w .j a va 2 s . c om*/ * Check if this device has front camera */ public static boolean checkFrontCamera(Context context) { if (context.getPackageManager().hasSystemFeature( PackageManager.FEATURE_CAMERA_FRONT)) { // this device has front camera return true; } else { // no front camera on this device return false; } } }