Stay organized with collections
Save and categorize content based on your preferences.
CameraProfile
public
class
CameraProfile
extends Object
The CameraProfile class is used to retrieve the pre-defined still image
capture (jpeg) quality levels (0-100) used for low, medium, and high
quality settings in the Camera application.
Summary
Public methods |
static
int
|
getJpegEncodingQualityParameter(int quality)
Returns a pre-defined still image capture (jpeg) quality level
used for the given quality level in the Camera application for
the first back-facing camera on the device.
|
static
int
|
getJpegEncodingQualityParameter(int cameraId, int quality)
Returns a pre-defined still image capture (jpeg) quality level
used for the given quality level in the Camera application for
the specified camera.
|
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
QUALITY_HIGH
public static final int QUALITY_HIGH
Constant Value:
2
(0x00000002)
QUALITY_LOW
public static final int QUALITY_LOW
Define three quality levels for JPEG image encoding.
Constant Value:
0
(0x00000000)
QUALITY_MEDIUM
public static final int QUALITY_MEDIUM
Constant Value:
1
(0x00000001)
Public constructors
CameraProfile
public CameraProfile ()
Public methods
getJpegEncodingQualityParameter
public static int getJpegEncodingQualityParameter (int quality)
Returns a pre-defined still image capture (jpeg) quality level
used for the given quality level in the Camera application for
the first back-facing camera on the device. If the device has no
back-facing camera, this returns 0.
Parameters |
quality |
int : The target quality level |
getJpegEncodingQualityParameter
public static int getJpegEncodingQualityParameter (int cameraId,
int quality)
Returns a pre-defined still image capture (jpeg) quality level
used for the given quality level in the Camera application for
the specified camera.
Parameters |
cameraId |
int : The id of the camera |
quality |
int : The target quality level |
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,["# CameraProfile\n\nAdded in [API level 8](/guide/topics/manifest/uses-sdk-element#ApiLevels) \nSummary: [Constants](#constants) \\| [Ctors](#pubctors) \\| [Methods](#pubmethods) \\| [Inherited Methods](#inhmethods) \n\nCameraProfile\n=============\n\n*** ** * ** ***\n\n[Kotlin](/reference/kotlin/android/media/CameraProfile \"View this page in Kotlin\") \\|Java\n\n\n`\npublic\n\n\nclass\nCameraProfile\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.media.CameraProfile |\n\n\u003cbr /\u003e\n\n*** ** * ** ***\n\nThe CameraProfile class is used to retrieve the pre-defined still image\ncapture (jpeg) quality levels (0-100) used for low, medium, and high\nquality settings in the Camera application.\n\nSummary\n-------\n\n| ### Constants ||\n|-------|------------------------------------------------------------------------------------------------------------------------|\n| `int` | [QUALITY_HIGH](/reference/android/media/CameraProfile#QUALITY_HIGH) |\n| `int` | [QUALITY_LOW](/reference/android/media/CameraProfile#QUALITY_LOW) Define three quality levels for JPEG image encoding. |\n| `int` | [QUALITY_MEDIUM](/reference/android/media/CameraProfile#QUALITY_MEDIUM) |\n\n| ### Public constructors ||\n|---------------------------------------------------------------------------------|---|\n| ` `[CameraProfile](/reference/android/media/CameraProfile#CameraProfile())`() ` |\n\n| ### Public methods ||\n|---------------|-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|\n| ` static int` | ` `[getJpegEncodingQualityParameter](/reference/android/media/CameraProfile#getJpegEncodingQualityParameter(int))`(int quality) ` Returns a pre-defined still image capture (jpeg) quality level used for the given quality level in the Camera application for the first back-facing camera on the device. |\n| ` static int` | ` `[getJpegEncodingQualityParameter](/reference/android/media/CameraProfile#getJpegEncodingQualityParameter(int,%20int))`(int cameraId, int quality) ` Returns a pre-defined still image capture (jpeg) quality level used for the given quality level in the Camera application for the specified camera. |\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### QUALITY_HIGH\n\nAdded in [API level 8](/guide/topics/manifest/uses-sdk-element#ApiLevels) \n\n```\npublic static final int QUALITY_HIGH\n```\n\n\u003cbr /\u003e\n\n\u003cbr /\u003e\n\nConstant Value:\n\n2\n(0x00000002)\n\n\n### QUALITY_LOW\n\nAdded in [API level 8](/guide/topics/manifest/uses-sdk-element#ApiLevels) \n\n```\npublic static final int QUALITY_LOW\n```\n\nDefine three quality levels for JPEG image encoding.\n\n\u003cbr /\u003e\n\nConstant Value:\n\n0\n(0x00000000)\n\n\n### QUALITY_MEDIUM\n\nAdded in [API level 8](/guide/topics/manifest/uses-sdk-element#ApiLevels) \n\n```\npublic static final int QUALITY_MEDIUM\n```\n\n\u003cbr /\u003e\n\n\u003cbr /\u003e\n\nConstant Value:\n\n1\n(0x00000001)\n\n\nPublic constructors\n-------------------\n\n### CameraProfile\n\n```\npublic CameraProfile ()\n```\n\n\u003cbr /\u003e\n\n\u003cbr /\u003e\n\nPublic methods\n--------------\n\n### getJpegEncodingQualityParameter\n\nAdded in [API level 8](/guide/topics/manifest/uses-sdk-element#ApiLevels) \n\n```\npublic static int getJpegEncodingQualityParameter (int quality)\n```\n\nReturns a pre-defined still image capture (jpeg) quality level\nused for the given quality level in the Camera application for\nthe first back-facing camera on the device. If the device has no\nback-facing camera, this returns 0.\n\n\u003cbr /\u003e\n\n| Parameters ||\n|-----------|----------------------------------------|\n| `quality` | `int`: The target quality level \u003cbr /\u003e |\n\n| Returns ||\n|-------|--------|\n| `int` | \u003cbr /\u003e |\n\n### getJpegEncodingQualityParameter\n\nAdded in [API level 9](/guide/topics/manifest/uses-sdk-element#ApiLevels) \n\n```\npublic static int getJpegEncodingQualityParameter (int cameraId, \n int quality)\n```\n\nReturns a pre-defined still image capture (jpeg) quality level\nused for the given quality level in the Camera application for\nthe specified camera.\n\n\u003cbr /\u003e\n\n| Parameters ||\n|------------|----------------------------------------|\n| `cameraId` | `int`: The id of the camera \u003cbr /\u003e |\n| `quality` | `int`: The target quality level \u003cbr /\u003e |\n\n| Returns ||\n|-------|--------|\n| `int` | \u003cbr /\u003e |"]]