Stay organized with collections
Save and categorize content based on your preferences.
CameraInfo
open class CameraInfo
Information about a camera
Summary
Constants |
static Int |
The facing of the camera is opposite to that of the screen.
|
static Int |
The facing of the camera is the same as that of the screen.
|
Properties |
Boolean |
Whether the shutter sound can be disabled.
|
Int |
The direction that the camera faces.
|
Int |
The orientation of the camera image.
|
Constants
CAMERA_FACING_BACK
static val CAMERA_FACING_BACK: Int
Deprecated: Deprecated in Java.
The facing of the camera is opposite to that of the screen.
Value: 0
CAMERA_FACING_FRONT
static val CAMERA_FACING_FRONT: Int
Deprecated: Deprecated in Java.
The facing of the camera is the same as that of the screen.
Value: 1
Public constructors
Properties
canDisableShutterSound
var canDisableShutterSound: Boolean
Deprecated: Deprecated in Java.
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 android.hardware.Camera#takePicture is called.
facing
var facing: Int
Deprecated: Deprecated in Java.
The direction that the camera faces. It should be CAMERA_FACING_BACK or CAMERA_FACING_FRONT.
orientation
var orientation: Int
Deprecated: Deprecated in Java.
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.
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.
[[["Easy to understand","easyToUnderstand","thumb-up"],["Solved my problem","solvedMyProblem","thumb-up"],["Other","otherUp","thumb-up"]],[["Missing the information I need","missingTheInformationINeed","thumb-down"],["Too complicated / too many steps","tooComplicatedTooManySteps","thumb-down"],["Out of date","outOfDate","thumb-down"],["Samples / code issue","samplesCodeIssue","thumb-down"],["Other","otherDown","thumb-down"]],["Last updated 2025-02-10 UTC."],[],[],null,["# Camera.CameraInfo\n\nAdded in [API level 9](https://developer.android.com/guide/topics/manifest/uses-sdk-element.html#ApiLevels) \nDeprecated in [API level 21](https://developer.android.com/guide/topics/manifest/uses-sdk-element.html#ApiLevels)\n\nCameraInfo\n==========\n\n*** ** * ** ***\n\nKotlin \\|[Java](/reference/android/hardware/Camera.CameraInfo \"View this page in Java\") \n\n```\nopen class CameraInfo\n```\n\n|---|-----------------------------------------|\n| [kotlin.Any](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-any/index.html) ||\n| ↳ | [android.hardware.Camera.CameraInfo](#) |\n\n*** ** * ** ***\n\n| **This class was deprecated in API level 21.**\n|\n| We recommend using the new [android.hardware.camera2](/reference/kotlin/android/hardware/camera2/package-summary) API for new applications.\n\nInformation about a camera\n\nSummary\n-------\n\n| Constants ||\n|-----------------------------------------------------------------------------------|--------------------------------------------------------------------------------------------------------------------|\n| static [Int](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-int/index.html) | [CAMERA_FACING_BACK](#CAMERA_FACING_BACK:kotlin.Int) The facing of the camera is opposite to that of the screen. |\n| static [Int](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-int/index.html) | [CAMERA_FACING_FRONT](#CAMERA_FACING_FRONT:kotlin.Int) The facing of the camera is the same as that of the screen. |\n\n| Public constructors ||\n|----------------------------------------|---|\n| [CameraInfo](#CameraInfo())`()` \u003cbr /\u003e |\n\n| Properties ||\n|------------------------------------------------------------------------------------|-------------------------------------------------------------------------------------------------------------|\n| [Boolean](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-boolean/index.html) | [canDisableShutterSound](#canDisableShutterSound:kotlin.Boolean) Whether the shutter sound can be disabled. |\n| [Int](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-int/index.html) | [facing](#facing:kotlin.Int) The direction that the camera faces. |\n| [Int](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-int/index.html) | [orientation](#orientation:kotlin.Int) The orientation of the camera image. |\n\nConstants\n---------\n\n### CAMERA_FACING_BACK\n\nAdded in [API level 9](https://developer.android.com/guide/topics/manifest/uses-sdk-element.html#ApiLevels) \n\n```\nstatic val CAMERA_FACING_BACK: Int\n```\n\n**Deprecated:** *Deprecated in Java.*\n\nThe facing of the camera is opposite to that of the screen. \n\n Value: 0\n\n### CAMERA_FACING_FRONT\n\nAdded in [API level 9](https://developer.android.com/guide/topics/manifest/uses-sdk-element.html#ApiLevels) \n\n```\nstatic val CAMERA_FACING_FRONT: Int\n```\n\n**Deprecated:** *Deprecated in Java.*\n\nThe facing of the camera is the same as that of the screen. \n\n Value: 1\n\nPublic constructors\n-------------------\n\n### CameraInfo\n\n```\nCameraInfo()\n```\n\nProperties\n----------\n\n### canDisableShutterSound\n\nAdded in [API level 17](https://developer.android.com/guide/topics/manifest/uses-sdk-element.html#ApiLevels) \nDeprecated in [API level 21](https://developer.android.com/guide/topics/manifest/uses-sdk-element.html#ApiLevels) \n\n```\nvar canDisableShutterSound: Boolean\n```\n\n**Deprecated:** *Deprecated in Java.*\n\nWhether the shutter sound can be disabled.\n\nOn some devices, the camera shutter sound cannot be turned off through [enableShutterSound](/reference/kotlin/android/hardware/Camera#enableShutterSound(kotlin.Boolean)). This field can be used to determine whether a call to disable the shutter sound will succeed.\n\nIf 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 android.hardware.Camera#takePicture is called. \n\n### facing\n\nAdded in [API level 9](https://developer.android.com/guide/topics/manifest/uses-sdk-element.html#ApiLevels) \n\n```\nvar facing: Int\n```\n\n**Deprecated:** *Deprecated in Java.*\n\nThe direction that the camera faces. It should be CAMERA_FACING_BACK or CAMERA_FACING_FRONT. \n\n### orientation\n\nAdded in [API level 9](https://developer.android.com/guide/topics/manifest/uses-sdk-element.html#ApiLevels) \n\n```\nvar orientation: Int\n```\n\n**Deprecated:** *Deprecated in Java.*\n\nThe 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.\n\nFor 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. \n**See Also**\n\n- [#setDisplayOrientation(int)](/reference/kotlin/android/hardware/Camera#setDisplayOrientation(kotlin.Int))\n- [android.hardware.Camera.Parameters#setRotation(int)](/reference/kotlin/android/hardware/Camera.Parameters#setRotation(kotlin.Int))\n- [android.hardware.Camera.Parameters#setPreviewSize(int, int)](/reference/kotlin/android/hardware/Camera.Parameters#setPreviewSize(kotlin.Int,%20kotlin.Int))\n- [android.hardware.Camera.Parameters#setPictureSize(int, int)](/reference/kotlin/android/hardware/Camera.Parameters#setPictureSize(kotlin.Int,%20kotlin.Int))\n- [android.hardware.Camera.Parameters#setJpegThumbnailSize(int, int)](/reference/kotlin/android/hardware/Camera.Parameters#setJpegThumbnailSize(kotlin.Int,%20kotlin.Int))"]]