is Support Camera - Android Camera

Android examples for Camera:Camera Feature

Description

is Support Camera

Demo Code


//package com.java2s;

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

public class Main {

    public static boolean isSupportCamera(Context context) {
        return isSupportBackCamera(context)
                || isSupportFrontCamera(context);
    }/*  w  w  w . j  a  va2  s  .c om*/

    public static boolean isSupportBackCamera(Context context) {
        PackageManager pm = context.getPackageManager();
        return pm.hasSystemFeature(PackageManager.FEATURE_CAMERA);
    }

    public static boolean isSupportFrontCamera(Context context) {
        PackageManager pm = context.getPackageManager();
        return pm.hasSystemFeature(PackageManager.FEATURE_CAMERA_FRONT);
    }
}

Related Tutorials