Index of every page on this site: llms.txt
All skills
android avatar

/camerax

@7f7b217
by androidandroid/skills11k stars
703
Run it yourself

Provide technical guidance for Android camera development with CameraX. Use when implementing camera features, handling asynchronous recording lifecycles, wiring low-level hardware interop using CameraX, or integrating ML Kit or Media3 effects.

Use this Skill: https://skilld.dev/gh/android/skills/camerax

Nothing lands on disk. Nothing to clean up.

Fork this Skill

Edit a local copy. It keeps the author and licence.

referencesmodern-apis.md

≈507 tokens on demand. Your agent reads this file only when SKILL.md points to it.

Always prefer these various abstractions over legacy Camera2 or early CameraX implementations.

Compare APIs

Use case Legacy or verbose way Recommendation
QR or face scanning ImageAnalysis.Analyzer and manual ByteBuffer math MlKitAnalyzer, which automates coordinate mapping and multi-format support
Post-processing Custom OpenGL shaders or SurfaceTexture Media3Effect for composable, declarative effects
Dual camera Manual binding of two UseCases ConcurrentCamera, which provides built-in support in CameraX 1.3 and higher
High dynamic range Manual bit-depth and profile config DynamicRange , which uses DYNAMIC_RANGE_HLG10 or SDR
Zoom and focus Camera2Interop for CameraX-to-Camera2 mapping CameraControl.setZoomRatio or setLinearZoom

Hardware awareness

Modern APIs abstract away the complexity of hardware diversity.

  • CameraSelector : Use DEFAULT_BACK_CAMERA or DEFAULT_FRONT_CAMERA instead of hardcoding camera IDs. Use filter if you need specific lens capabilities.
  • Extensions : Before enabling advanced modes, such as night, bokeh, and face retouch, use ExtensionsManager to query whether the device supports them.
  • Foldables : Observe Lifecycle and Viewport updates to handle posture changes, like a half-opened posture, on foldable devices.

Required dependencies

Add the following dependencies to your libs.versions.toml file:

# CameraX ML Kit

androidx-camera-mlkit-vision = { group = "androidx.camera", name =
"camera-mlkit-vision", version.ref = "camerax" }

# Media3 effects

androidx-media3-effect = { group = "androidx.media3", name = "media3-effect",
version.ref = "media3" }

# Camera extensions

androidx-camera-extensions = { group = "androidx.camera", name =
"camera-extensions", version.ref = "camerax" }

Refer to the official CameraX Release Notes for the stable versions.

Source: SKILL.md on GitHub

No rule matched.

skilld matched fixed text patterns in SKILL.md and file names. Patterns miss obfuscated code.

skilld run checks every file with the same patterns. It asks for approval before it loads a Skill with a behavior marked Needs approval.

No alerts6d3 checks · Risk SAFE
  • Gen Agent Trust Hub7d

    The skill provides technical guidance for Android CameraX development, covering migration from legacy APIs, handling device diversity (foldables, Wear OS, XR), and integrating with ML Kit and Media3. No security issues were detected; all code snippets and external references originate from trusted sources and follow standard platform patterns.

  • Socket6d

    No alerts

  • Snyk7d

    Risk: LOW · No issues

Signed by skilld at 7f7b217. This ties the file your Agent reads to that commit on GitHub. It does not review the instructions.

Last checked against GitHub 1 hour ago.

Activeupdated last week
Other metadata
metadata
{
  "author": "Google LLC",
  "last-updated": "2026-11-10",
  "keywords": [
    "recipe",
    "Android",
    "Camera",
    "Camera1",
    "Camera2",
    "CameraX",
    "migration",
    "Compose",
    "guide",
    "dependencies",
    "PreviewView",
    "CameraXViewfinder",
    "ImageCapture",
    "VideoCapture",
    "ImageAnalysis."
  ]
}

README badge

README badge for android/skills/camerax