Check if this device has a camera - Android android.hardware

Android examples for android.hardware:Camera State

Description

Check if this device has a camera

Demo Code

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

public class Main{

    /**//from   w ww.  j  av a  2 s  .c o  m
     * 
     */
    public static boolean checkCameraHardware(Context context) {
        return (context.getPackageManager()
                .hasSystemFeature(PackageManager.FEATURE_CAMERA));
    }

}

Related Tutorials