Android Camera Check checkFrontCamera(Context context)

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

Description

Check if this device has front camera

License

Open Source License

Declaration

public static boolean checkFrontCamera(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 {
    /**/*from   w  w  w .j a va 2 s  .  c  om*/
     * Check if this device has front camera
     */
    public static boolean checkFrontCamera(Context context) {
        if (context.getPackageManager().hasSystemFeature(
                PackageManager.FEATURE_CAMERA_FRONT)) {
            // this device has front camera
            return true;
        } else {
            // no front camera on this device
            return false;
        }
    }
}

Related

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