Android Camera Check checkCameraHardware(Context context)

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

Description

Check if this device has a camera

License

Open Source License

Declaration

public static boolean checkCameraHardware(Context context) 

Method Source Code

//package com.java2s;
//License from project: Open Source License 

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

public class Main {
    /**/*  w ww  .j  a v a2 s .com*/
     * 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. isVideoSnapshotSupported(Parameters params)
  2. throwIfCameraDisabled(Activity activity)
  3. isCameraFlashSupported(Context context)
  4. isCameraSupported(Context context)
  5. isPortrait(Context context)
  6. checkCameraHardware(Context context)
  7. checkCameraHardware(Context context)
  8. checkCameraHardware(Context context)
  9. checkFrontCamera(Context context)