check Camera Hardware - Android android.hardware

Android examples for android.hardware:Camera

Description

check Camera Hardware

Demo Code

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

public class Main {

  /**/* ww  w  . j a v a  2 s  . c  o  m*/
   * 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 Tutorials