Added in API level 8

CameraProfile


open class CameraProfile
kotlin.Any
   ↳ android.media.CameraProfile

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

Constants
static Int

static Int

Define three quality levels for JPEG image encoding.

static Int

Public constructors

Public methods
open static Int

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.

open static Int
getJpegEncodingQualityParameter(cameraId: Int, quality: Int)

Returns a pre-defined still image capture (jpeg) quality level used for the given quality level in the Camera application for the specified camera.

Constants

QUALITY_HIGH

Added in API level 8
static val QUALITY_HIGH: Int
Value: 2

QUALITY_LOW

Added in API level 8
static val QUALITY_LOW: Int

Define three quality levels for JPEG image encoding.

Value: 0

QUALITY_MEDIUM

Added in API level 8
static val QUALITY_MEDIUM: Int
Value: 1

Public constructors

CameraProfile

CameraProfile()

Public methods

getJpegEncodingQualityParameter

Added in API level 8
open static fun getJpegEncodingQualityParameter(quality: Int): Int

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

Added in API level 9
open static fun getJpegEncodingQualityParameter(
    cameraId: Int,
    quality: Int
): Int

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