The Android Developer Challenge is back! Submit your idea before December 2.

CameraInfo

interface CameraInfo
androidx.camera.core.CameraInfo

An interface for retrieving camera information.

Applications can retrieve an instance via CameraX#getCameraInfo(CameraX.LensFacing).

Summary

Public methods

abstract Int

Returns the sensor rotation, in degrees, relative to the device's "natural" rotation.

abstract Int
getSensorRotationDegrees(relativeRotation: Int)

Returns the sensor rotation, in degrees, relative to the given rotation value.

abstract LiveData<Boolean!>

Returns if flash unit is available or not.

Public methods

getSensorRotationDegrees

abstract fun getSensorRotationDegrees(): Int

Returns the sensor rotation, in degrees, relative to the device's "natural" rotation.

Return
Int: The sensor orientation in degrees.

getSensorRotationDegrees

abstract fun getSensorRotationDegrees(relativeRotation: Int): Int

Returns the sensor rotation, in degrees, relative to the given rotation value.

Valid values for the relative rotation are Surface#ROTATION_0, , Surface#ROTATION_180, Surface#ROTATION_270.

Parameters
relativeRotation Int: The rotation relative to which the output will be calculated.
Return
Int: The sensor orientation in degrees.

isFlashAvailable

@NonNull abstract fun isFlashAvailable(): LiveData<Boolean!>

Returns if flash unit is available or not.