check For Front Camera - Android android.hardware

Android examples for android.hardware:Front Camera

Description

check For Front Camera

Demo Code

import android.app.Activity;
import android.content.Context;
import android.content.pm.PackageManager;
import android.hardware.Camera;
import android.view.Surface;

public class Main{

    public static boolean checkForFrontCam(Context context) {
        if (context.getPackageManager().hasSystemFeature(
                PackageManager.FEATURE_CAMERA_FRONT)) {
            return true;
        } else {/*from w  ww.j a  v a2s  .  co  m*/
            return false;
        }
    }

}

Related Tutorials