Check if a device has Front Camera - Android Camera

Android examples for Camera:Front Camera

Description

Check if a device has Front Camera

Demo Code


//package com.java2s;
import android.content.Context;
import android.content.pm.PackageManager;

public class Main {
    public static boolean hasFrontCamera(Context context) {
        if (context.getPackageManager().hasSystemFeature(
                PackageManager.FEATURE_CAMERA_FRONT)) {
            return true;
        } else {// ww w . j  av  a 2s. com
            return false;
        }
    }
}

Related Tutorials