camera1-to-camerax
OfficialMigrate Camera1 to CameraX in a sane way
System Documentation
What problem does it solve?
It solves the pain of migrating legacy Android camera code (Camera1 and raw Camera2 usage) that suffers from lifecycle fragility, rotation bugs, and device-specific dependency headaches.
Core Features & Use Cases
- CameraX dependency setup: Add compatible CameraX libraries (including interoperability requirements for specific Compose extensions).
- Lifecycle-aware camera binding: Replace manual camera open/close and custom lifecycle code with ProcessCameraProvider and bind use cases to a LifecycleOwner.
- Preview, tap-to-focus, and capture: Implement Preview and ImageCapture with correct focus metering and safe ImageProxy handling.
Use it when modernizing an existing app that currently uses SurfaceView/SurfaceHolder callbacks, manual orientation matrices, and onResume/onPause camera management, but needs a CameraX-based implementation with Compose or Views.
Quick Start
Ask an AI to rewrite your current Camera1/Camera2 camera preview, focus, and photo-capture code into a CameraX implementation that binds to a LifecycleOwner, uses ProcessCameraProvider, supports tap-to-focus, and correctly closes ImageProxy.
Dependency Matrix
Required Modules
None requiredComponents
Standard package💻 Claude Code Installation
Recommended: Let Claude install automatically. Simply copy and paste the text below to Claude Code.
Please help me install this Skill: Name: camera1-to-camerax Download link: https://github.com/premex-ab/claude-marketplace/archive/main.zip#camera1-to-camerax Please download this .zip file, extract it, and install it in the .claude/skills/ directory.
Agent Skills Search Helper
Install a tiny helper to your Agent, search and equip skill from 471,000+ vetted skills library on demand.