Android Camera Check checkCameraHardware(Context context)

Here you can find the source of checkCameraHardware(Context context)

Description

Check if this device has a camera

Declaration

public static boolean checkCameraHardware(Context context) 

Method Source Code

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

import android.content.pm.PackageManager;

public class Main {
    /**/* w  w  w  . java2  s  .  c om*/
     * Check if this device has a camera
     */
    public static boolean checkCameraHardware(Context context) {
        if (context.getPackageManager().hasSystemFeature(
                PackageManager.FEATURE_CAMERA)) {
            // this device has a camera
            return true;
        } else {
            // no camera on this device
            return false;
        }
    }
}

Related

  1. isCameraSupported(Context context)
  2. isPortrait(Context context)
  3. checkCameraHardware(Context context)
  4. checkCameraHardware(Context context)
  5. checkCameraHardware(Context context)
  6. checkFrontCamera(Context context)
  7. deviceHasCamera(Context context)
  8. sizeSupported(Camera.Parameters cp, CamcorderProfile profile)
  9. hasFlash(Camera mCamera)