What problem does it solve?
Building a reliable camera screen is hard because lifecycles, permissions, and recording/capture flows easily break across devices, orientations, and UI recompositions.
Core Features & Use Cases
- Lifecycle-aware CameraX setup in Android apps using
ProcessCameraProvider so preview and capture start/stop safely with the UI lifecycle.
- Video recording to MediaStore with
VideoCapture and MediaStoreOutputOptions, including optional audio support for MP4 gallery-ready videos.
- Photo capture to MediaStore with
ImageCapture and correct ContentValues for gallery placement.
- Simultaneous preview + video + photo, with runtime capability checks via
CameraInfo.isUseCaseCombinationSupported() for older devices.
- Camera controls including dynamic front/back selection and torch/flashlight control with state observation.
- Safety and quality guardrails like explicit
QualitySelector, strong references to active recordings, and anti-pattern fixes for common IllegalStateException and finalize issues.
Quick Start
Use the android-video-capture skill to implement a Compose camera preview that records an audio-enabled video to the gallery and captures photos with torch support.