Android Utililty Methods Camera Check

List of utility methods to do Camera Check

Description

The list of methods to do Camera Check are organized into topic(s).

Method

voiddumpParameters(Parameters parameters)
dump Parameters
String flattened = parameters.flatten();
StringTokenizer tokenizer = new StringTokenizer(flattened, ";");
Log.d(TAG, "Dump all camera parameters:");
while (tokenizer.hasMoreElements()) {
    Log.d(TAG, tokenizer.nextToken());
intgetCameraFacingIntentExtras(Activity currentActivity)
get Camera Facing Intent Extras
int cameraId = -1;
int intentCameraId = currentActivity.getIntent().getIntExtra(
        CameraUtil.EXTRAS_CAMERA_FACING, -1);
if (isFrontCameraIntent(intentCameraId)) {
    int frontCameraId = CameraHolder.instance().getFrontCameraId();
    if (frontCameraId != -1) {
        cameraId = frontCameraId;
} else if (isBackCameraIntent(intentCameraId)) {
    int backCameraId = CameraHolder.instance().getBackCameraId();
    if (backCameraId != -1) {
        cameraId = backCameraId;
return cameraId;
booleanisAutoExposureLockSupported(Parameters params)
is Auto Exposure Lock Supported
return TRUE.equals(params.get(AUTO_EXPOSURE_LOCK_SUPPORTED));
booleanisAutoWhiteBalanceLockSupported(Parameters params)
is Auto White Balance Lock Supported
return TRUE.equals(params.get(AUTO_WHITE_BALANCE_LOCK_SUPPORTED));
booleanisBackCameraIntent(int intentCameraId)
is Back Camera Intent
return (intentCameraId == android.hardware.Camera.CameraInfo.CAMERA_FACING_BACK);
booleanisCameraHdrSupported(Parameters params)
is Camera Hdr Supported
List<String> supported = params.getSupportedSceneModes();
return (supported != null) && supported.contains(SCENE_MODE_HDR);
booleanisFocusAreaSupported(Parameters params)
is Focus Area Supported
return (params.getMaxNumFocusAreas() > 0 && isSupported(
        Parameters.FOCUS_MODE_AUTO, params.getSupportedFocusModes()));
booleanisFrontCameraIntent(int intentCameraId)
is Front Camera Intent
return (intentCameraId == android.hardware.Camera.CameraInfo.CAMERA_FACING_FRONT);
booleanisMeteringAreaSupported(Parameters params)
is Metering Area Supported
return params.getMaxNumMeteringAreas() > 0;
booleanisVideoSnapshotSupported(Parameters params)
is Video Snapshot Supported
return TRUE.equals(params.get(VIDEO_SNAPSHOT_SUPPORTED));