Stay organized with collections
Save and categorize content based on your preferences.
Camera.CameraInfo
public
static
class
Camera.CameraInfo
extends Object
This class was deprecated
in API level 21.
We recommend using the new android.hardware.camera2
API for new
applications.
Information about a camera
Summary
Fields |
public
boolean |
canDisableShutterSound
Whether the shutter sound can be disabled.
|
public
int |
facing
The direction that the camera faces.
|
public
int |
orientation
The orientation of the camera image.
|
Inherited methods |
From class
java.lang.Object
Object
|
clone()
Creates and returns a copy of this object.
|
boolean
|
equals(Object obj)
Indicates whether some other object is "equal to" this one.
|
void
|
finalize()
Called by the garbage collector on an object when garbage collection
determines that there are no more references to the object.
|
final
Class<?>
|
getClass()
Returns the runtime class of this Object .
|
int
|
hashCode()
Returns a hash code value for the object.
|
final
void
|
notify()
Wakes up a single thread that is waiting on this object's
monitor.
|
final
void
|
notifyAll()
Wakes up all threads that are waiting on this object's monitor.
|
String
|
toString()
Returns a string representation of the object.
|
final
void
|
wait(long timeoutMillis, int nanos)
Causes the current thread to wait until it is awakened, typically
by being notified or interrupted, or until a
certain amount of real time has elapsed.
|
final
void
|
wait(long timeoutMillis)
Causes the current thread to wait until it is awakened, typically
by being notified or interrupted, or until a
certain amount of real time has elapsed.
|
final
void
|
wait()
Causes the current thread to wait until it is awakened, typically
by being notified or interrupted.
|
|
Constants
CAMERA_FACING_BACK
public static final int CAMERA_FACING_BACK
The facing of the camera is opposite to that of the screen.
Constant Value:
0
(0x00000000)
CAMERA_FACING_FRONT
public static final int CAMERA_FACING_FRONT
The facing of the camera is the same as that of the screen.
Constant Value:
1
(0x00000001)
Fields
canDisableShutterSound
public boolean canDisableShutterSound
Whether the shutter sound can be disabled.
On some devices, the camera shutter sound cannot be turned off
through enableShutterSound
. This field
can be used to determine whether a call to disable the shutter sound
will succeed.
If this field is set to true, then a call of
enableShutterSound(false)
will be successful. If set to
false, then that call will fail, and the shutter sound will be played
when takePicture
is called.
facing
public int facing
The direction that the camera faces. It should be
CAMERA_FACING_BACK or CAMERA_FACING_FRONT.
orientation
public int orientation
The orientation of the camera image. The value is the angle that the
camera image needs to be rotated clockwise so it shows correctly on
the display in its natural orientation. It should be 0, 90, 180, or 270.
For example, suppose a device has a naturally tall screen. The
back-facing camera sensor is mounted in landscape. You are looking at
the screen. If the top side of the camera sensor is aligned with the
right edge of the screen in natural orientation, the value should be
90. If the top side of a front-facing camera sensor is aligned with
the right of the screen, the value should be 270.
Public constructors
CameraInfo
public CameraInfo ()
Content and code samples on this page are subject to the licenses described in the Content License. Java and OpenJDK are trademarks or registered trademarks of Oracle and/or its affiliates.
Last updated 2025-02-10 UTC.
[null,null,["Last updated 2025-02-10 UTC."],[],[],null,["# Camera.CameraInfo\n\nAdded in [API level 9](/guide/topics/manifest/uses-sdk-element#ApiLevels) \nDeprecated in [API level\n21](/guide/topics/manifest/uses-sdk-element#ApiLevels) \nSummary: [Constants](#constants) \\| [Fields](#lfields) \\| [Ctors](#pubctors) \\| [Inherited Methods](#inhmethods) \n\nCamera.CameraInfo\n=================\n\n*** ** * ** ***\n\n[Kotlin](/reference/kotlin/android/hardware/Camera.CameraInfo \"View this page in Kotlin\") \\|Java\n\n\n`\npublic\nstatic\n\n\nclass\nCamera.CameraInfo\n`\n\n\n`\n\nextends `[Object](/reference/java/lang/Object)`\n\n\n`\n\n`\n\n\n`\n\n|---|------------------------------------|\n| [java.lang.Object](/reference/java/lang/Object) ||\n| ↳ | android.hardware.Camera.CameraInfo |\n\n\u003cbr /\u003e\n\n*** ** * ** ***\n\n\n**This class was deprecated\nin API level 21.** \n\nWe recommend using the new [android.hardware.camera2](/reference/android/hardware/camera2/package-summary) API for new\napplications.\n\nInformation about a camera\n\nSummary\n-------\n\n| ### Constants ||\n|-------|------------------------------------------------------------------------------------------------------------------------------------------------------|\n| `int` | [CAMERA_FACING_BACK](/reference/android/hardware/Camera.CameraInfo#CAMERA_FACING_BACK) The facing of the camera is opposite to that of the screen. |\n| `int` | [CAMERA_FACING_FRONT](/reference/android/hardware/Camera.CameraInfo#CAMERA_FACING_FRONT) The facing of the camera is the same as that of the screen. |\n\n| ### Fields ||\n|-------------------|--------------------------------------------------------------------------------------------------------------------------------------------------|\n| ` public boolean` | [canDisableShutterSound](/reference/android/hardware/Camera.CameraInfo#canDisableShutterSound) \u003cbr /\u003e Whether the shutter sound can be disabled. |\n| ` public int` | [facing](/reference/android/hardware/Camera.CameraInfo#facing) The direction that the camera faces. |\n| ` public int` | [orientation](/reference/android/hardware/Camera.CameraInfo#orientation) \u003cbr /\u003e The orientation of the camera image. |\n\n| ### Public constructors ||\n|----------------------------------------------------------------------------------|---|\n| ` `[CameraInfo](/reference/android/hardware/Camera.CameraInfo#CameraInfo())`() ` |\n\n| ### Inherited methods |\n|-----------------------|---|\n| From class ` `[java.lang.Object](/reference/java/lang/Object)` ` |---------------------------------------------------|--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------| | ` `[Object](/reference/java/lang/Object) | ` `[clone](/reference/java/lang/Object#clone())`() ` Creates and returns a copy of this object. | | ` boolean` | ` `[equals](/reference/java/lang/Object#equals(java.lang.Object))`(`[Object](/reference/java/lang/Object)` obj) ` Indicates whether some other object is \"equal to\" this one. | | ` void` | ` `[finalize](/reference/java/lang/Object#finalize())`() ` Called by the garbage collector on an object when garbage collection determines that there are no more references to the object. | | ` final `[Class](/reference/java/lang/Class)`\u003c?\u003e` | ` `[getClass](/reference/java/lang/Object#getClass())`() ` Returns the runtime class of this `Object`. | | ` int` | ` `[hashCode](/reference/java/lang/Object#hashCode())`() ` Returns a hash code value for the object. | | ` final void` | ` `[notify](/reference/java/lang/Object#notify())`() ` Wakes up a single thread that is waiting on this object's monitor. | | ` final void` | ` `[notifyAll](/reference/java/lang/Object#notifyAll())`() ` Wakes up all threads that are waiting on this object's monitor. | | ` `[String](/reference/java/lang/String) | ` `[toString](/reference/java/lang/Object#toString())`() ` Returns a string representation of the object. | | ` final void` | ` `[wait](/reference/java/lang/Object#wait(long,%20int))`(long timeoutMillis, int nanos) ` Causes the current thread to wait until it is awakened, typically by being *notified* or *interrupted*, or until a certain amount of real time has elapsed. | | ` final void` | ` `[wait](/reference/java/lang/Object#wait(long))`(long timeoutMillis) ` Causes the current thread to wait until it is awakened, typically by being *notified* or *interrupted*, or until a certain amount of real time has elapsed. | | ` final void` | ` `[wait](/reference/java/lang/Object#wait())`() ` Causes the current thread to wait until it is awakened, typically by being *notified* or *interrupted*. | ||\n\nConstants\n---------\n\n### CAMERA_FACING_BACK\n\nAdded in [API level 9](/guide/topics/manifest/uses-sdk-element#ApiLevels) \n\n```\npublic static final int CAMERA_FACING_BACK\n```\n\nThe facing of the camera is opposite to that of the screen.\n\n\u003cbr /\u003e\n\nConstant Value:\n\n0\n(0x00000000)\n\n\n### CAMERA_FACING_FRONT\n\nAdded in [API level 9](/guide/topics/manifest/uses-sdk-element#ApiLevels) \n\n```\npublic static final int CAMERA_FACING_FRONT\n```\n\nThe facing of the camera is the same as that of the screen.\n\n\u003cbr /\u003e\n\nConstant Value:\n\n1\n(0x00000001)\n\n\nFields\n------\n\n### canDisableShutterSound\n\nAdded in [API level 17](/guide/topics/manifest/uses-sdk-element#ApiLevels) \nDeprecated in [API level\n21](/guide/topics/manifest/uses-sdk-element#ApiLevels) \n\n```\npublic boolean canDisableShutterSound\n```\n\n\u003cbr /\u003e\n\nWhether the shutter sound can be disabled.\n\nOn some devices, the camera shutter sound cannot be turned off\nthrough [enableShutterSound](/reference/android/hardware/Camera#enableShutterSound(boolean)). This field\ncan be used to determine whether a call to disable the shutter sound\nwill succeed.\n\nIf this field is set to true, then a call of\n`enableShutterSound(false)` will be successful. If set to\nfalse, then that call will fail, and the shutter sound will be played\nwhen [takePicture](/reference/android/hardware/Camera#takePicture(android.hardware.Camera.ShutterCallback,%20android.hardware.Camera.PictureCallback,%20android.hardware.Camera.PictureCallback)) is called.\n\n\u003cbr /\u003e\n\n\u003cbr /\u003e\n\n### facing\n\nAdded in [API level 9](/guide/topics/manifest/uses-sdk-element#ApiLevels) \n\n```\npublic int facing\n```\n\nThe direction that the camera faces. It should be\nCAMERA_FACING_BACK or CAMERA_FACING_FRONT.\n\n\u003cbr /\u003e\n\n### orientation\n\nAdded in [API level 9](/guide/topics/manifest/uses-sdk-element#ApiLevels) \n\n```\npublic int orientation\n```\n\n\u003cbr /\u003e\n\nThe orientation of the camera image. The value is the angle that the\ncamera image needs to be rotated clockwise so it shows correctly on\nthe display in its natural orientation. It should be 0, 90, 180, or 270.\n\nFor example, suppose a device has a naturally tall screen. The\nback-facing camera sensor is mounted in landscape. You are looking at\nthe screen. If the top side of the camera sensor is aligned with the\nright edge of the screen in natural orientation, the value should be\n90. If the top side of a front-facing camera sensor is aligned with\nthe right of the screen, the value should be 270.\n\n\u003cbr /\u003e\n\n\u003cbr /\u003e\n\n**See also:**\n\n- [Camera.setDisplayOrientation(int)](/reference/android/hardware/Camera#setDisplayOrientation(int))\n- [Camera.Parameters.setRotation(int)](/reference/android/hardware/Camera.Parameters#setRotation(int))\n- [Camera.Parameters.setPreviewSize(int, int)](/reference/android/hardware/Camera.Parameters#setPreviewSize(int,%20int))\n- [Camera.Parameters.setPictureSize(int, int)](/reference/android/hardware/Camera.Parameters#setPictureSize(int,%20int))\n- [Camera.Parameters.setJpegThumbnailSize(int, int)](/reference/android/hardware/Camera.Parameters#setJpegThumbnailSize(int,%20int))\n\nPublic constructors\n-------------------\n\n### CameraInfo\n\n```\npublic CameraInfo ()\n```\n\n\u003cbr /\u003e\n\n\u003cbr /\u003e"]]