Check if hardware has back Camera - Android android.hardware

Android examples for android.hardware:Back Camera

Description

Check if hardware has back Camera

Demo Code

import android.content.Context;
import android.content.pm.PackageManager;
import android.os.Build;

public class Main{

    /**//from   www.  jav a 2 s .c  o m
     * @param context
     *         the application context
     * @return true if the device has a rear camera, false else
     */
    public static boolean hasCameraBack(Context context) {
        PackageManager pm = context.getPackageManager();
        return pm.hasSystemFeature(PackageManager.FEATURE_CAMERA);
    }

}

Related Tutorials