Android.Hardware.Camera.Open Method
Creates a new Camera object to access a particular hardware camera.

Syntax

[Android.Runtime.Register("open", "(I)Landroid/hardware/Camera;", "")]
[System.Obsolete("deprecated")]
public static Camera Open (int cameraId)

See Also

Android.App.Admin.DevicePolicyManager.GetCameraDisabled(Android.Content.ComponentName)

Parameters

cameraId
the hardware camera to access, between 0 and Camera.NumberOfCameras-1.

Returns

Documentation for this section has not yet been entered.

Exceptions

TypeReason
Java.Lang.RuntimeExceptionif opening the camera fails (for example, if the camera is in use by another process or device policy manager has disabled the camera).

Remarks

Creates a new Camera object to access a particular hardware camera. If the same camera is opened by other applications, this will throw a RuntimeException.

You must call Camera.Release when you are done using the camera, otherwise it will remain locked and be unavailable to other applications.

Your application should only have one Camera object active at a time for a particular hardware camera.

Callbacks from other methods are delivered to the event loop of the thread which called open(). If this thread has no event loop, then callbacks are delivered to the main application event loop. If there is no main application event loop, callbacks are not delivered.

Caution: On some devices, this method may take a long time to complete. It is best to call this method from a worker thread (possibly using Android.OS.AsyncTask`3) to avoid blocking the main application UI thread.

[Android Documentation]

Requirements

Namespace: Android.Hardware
Assembly: Mono.Android (in Mono.Android.dll)
Assembly Versions: 0.0.0.0
Since: Added in API level 9