# Class CameraInfo

java.lang.Object
com.codename1.camera.CameraInfo

public final class CameraInfo extends java.lang.Object

Describes a physical camera available on the device.

Returned by `Camera#getCameras()` and `Camera#getDefault(CameraFacing)`. Instances are immutable and may be passed to `Camera#open(CameraInfo, CameraSessionOptions)`.

- ## Constructor Summary

  Constructors
  Constructor
  Description
  `CameraInfo(String id, CameraFacing facing, Dimension[] photoSizes, Dimension[] previewSizes, boolean hasFlash, boolean hasAutoFocus)`
  Used by platform implementations.

- ## Method Summary

  Modifier and Type
  Method
  Description
  `CameraFacing`
  `getFacing()`
  Direction this camera faces relative to the device screen.
  `String`
  `getId()`
  Opaque, platform-specific identifier.
  `Dimension[]`
  `getPhotoSizes()`
  Supported still-photo resolutions, largest first.
  `Dimension[]`
  `getPreviewSizes()`
  Supported preview/frame-stream resolutions.
  `boolean`
  `hasAutoFocus()`
  True if this camera supports tap-to-focus / autofocus.
  `boolean`
  `hasFlash()`
  True if this camera has a flash/torch the application can drive via `CameraSession#setFlashMode(FlashMode)`.

  ### Methods inherited from class java.lang.Object

  `clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- ## Constructor Details

  - ### CameraInfo

    public CameraInfo(String id, CameraFacing facing, Dimension[] photoSizes, Dimension[] previewSizes, boolean hasFlash, boolean hasAutoFocus)
    Used by platform implementations. Application code obtains instances through `Camera#getCameras()`.

- ## Method Details

  - ### getId

    public String getId()
    Opaque, platform-specific identifier. Stable for the lifetime of the process.

  - ### getFacing

    public CameraFacing getFacing()
    Direction this camera faces relative to the device screen.

  - ### getPhotoSizes

    public Dimension[] getPhotoSizes()
    Supported still-photo resolutions, largest first. May be empty on platforms (e.g. the JavaSE simulator) that don't expose a discrete list.

  - ### getPreviewSizes

    public Dimension[] getPreviewSizes()
    Supported preview/frame-stream resolutions. May be empty on platforms that don't expose a discrete list.

  - ### hasFlash

    public boolean hasFlash()
    True if this camera has a flash/torch the application can drive via `CameraSession#setFlashMode(FlashMode)`.

  - ### hasAutoFocus

    public boolean hasAutoFocus()
    True if this camera supports tap-to-focus / autofocus.