camerax
Provide technical guidance for Android camera development with CameraX.
Install / Use
npx skills add android/skills --skill cameraxInstalls into whichever agent you are using.
SKILL.md
Installable skill definition
Quality Score
Category
Development & EngineeringSupported Platforms
Our assessment of camerax
camerax scores 88/100 on our quality scale, 1816th of 4,698 Development & Engineering skills we index (top 39%).
Its SKILL.md is 6.3 KB long, well organised into 8 sections with 1 code example: a thorough specification that gives an agent plenty to work with.
With 7,514 GitHub stars, it is one of the more widely adopted skills in the catalogue.
Maintenance, license and trust
- The repository was last updated about 2 months ago, so camerax is actively maintained.
- Our last check on 2026-10-31 found the source still online.
- It is released under the Apache-2.0 license, a permissive license that allows use, modification and commercial use with attribution.
- Its trust signals score 100/100, with no cautions. These come from repository metadata, not a code audit — read the skill file before letting an agent act on it.
Safety scan
No issues foundOur scan of the whole file found no instruction hijacking, hidden characters, credential access, data exfiltration or destructive commands. An AI review of the same text found nothing harmful.
AI review by kimi-k2.7-code on 2026-09-26. Automated pattern scan on 2026-09-26. It catches known dangerous patterns, not every risk — read a skill before letting an agent act on it.
camerax compared with similar skills
All 4 of these similar skills score higher than camerax; compare them before choosing.
| Skill | Score | Stars | Updated | Format |
|---|---|---|---|---|
| camerax (this skill)by android | 88 | 7.5k | 54d ago | SKILL.md |
| taste-skillby Leonxlnx | 100 | 116.8k | 8d ago | CLAUDE.md |
| ai-job-searchby ai-job-search-dev | 100 | 72.1k | today | CLAUDE.md |
| claude-howtoby luongnv89 | 100 | 47.3k | 2d ago | CLAUDE.md |
| Claude-Code-Game-Studiosby Donchitos | 100 | 39.7k | 7d ago | CLAUDE.md |
Frequently asked questions
- How do I install camerax?
- Run
npx skills add android/skills --skill camerax. The install tabs above show the steps for each supported agent. - Which AI agents does camerax work with?
- It is written for Universal, as a SKILL.md file. Other agents that read the same format can often use it too.
- Is camerax safe to use?
- Our scan of the whole file found no instruction hijacking, hidden characters, credential access, data exfiltration or destructive commands. An AI review of the same text found nothing harmful. It is Apache-2.0-licensed and scores 100/100 on trust signals. Skills are instructions an agent will follow, so read the file before installing it and do not approve commands you do not understand.
- Is camerax still maintained?
- The repository was last updated about 2 months ago, so camerax is actively maintained.
Skill content
View source on GitHubname: camerax description: 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. license: Complete terms in LICENSE.txt metadata: author: Google LLC last-updated: '2026-09-24' keywords:
- recipe
- Android
- Camera
- Camera1
- Camera2
- CameraX
- migration
- Compose
- guide
- dependencies
- PreviewView
- CameraXViewfinder
- ImageCapture
- VideoCapture
- ImageAnalysis.
This skill provides procedural guidance and standard patterns for building
camera applications on Android, with a focus on CameraX, including its
Camera2Interop utilities, and Media3 integrations.
Core workflows
Handling immutable API patterns
Various Android camera and media APIs, especially CameraX VideoCapture, use a
fluent, immutable builder-like pattern where methods return a new instance.
Failing to reassign these results in settings, such as audio, being ignored.
Pattern: Reassignment is required
// WRONG
run {
val pending = recorder.prepareRecording(context, opts)
pending.withAudioEnabled() // This returns a new instance which is ignored
val active = pending.start(exec, listener)
}
// CORRECT
run {
val pending = recorder.prepareRecording(context, opts)
.withAudioEnabled() // Chaining works
val active = pending.start(exec, listener)
}
// ALSO CORRECT
run {
var pending = recorder.prepareRecording(context, opts)
pending = pending.withAudioEnabled() // Reassignment
val active = pending.start(exec, listener)
}
<br />
See immutability for a list of affected classes.
Migrating to CameraX
When migrating legacy camera codebases to the CameraX Jetpack library:
- Camera1 to CameraX : For migrating legacy
android.hardware.Cameraimplementations, surface handling, and manual lifecycles, see the Camera1 migration guide. - Camera2 to CameraX : For migrating more recent but verbose
android.hardware.camera2implementations, session state callbacks, and interop patterns, see the Camera2 migration guide.
Comprehensive feature blueprinting
For multi-step features that involve multiple files and hardware-level wiring, follow the Structural Blueprinting approach to avoid system timeouts. Such complex features include:
- Manual controls : Break down into the
ViewModelstate, the controller layer, and theCamera2Interopwiring in the session. - RAW capture: Separate JPEG and RAW output configurations into discrete build steps.
- Custom effects : Prefer
Media3EffectorSurfaceProcessorover manual OpenGL pipelines unless absolute performance is required. - Low-light : See low-light for Night Mode and LLB guidance.
- Foldables : See foldables for handling dynamic postures and hinge states.
- XR, AR, and VR : See xr for spatial tracking, passthrough synchronization, and latency guardrails.
- Thermals and power : See thermals for managing
StreamUseCaseoptimizations andPowerManagerthermal states. - Testing and mocking : See testing for using
FakeCameraConfig, handling asynchronous lifecycles, and validating analysis pipelines. - ML Kit spatial analysis : See mlkit-spatial for coordinate mapping, rotation logic, and mirrored lens handling.
- Wear OS camera remote : See wear-os for circular UI constraints, Data Layer API syncing, and remote trigger logic.
See expert-blueprints for step-by-step guides.
API discovery
Always use higher-level abstractions instead of low-level manual wiring:
- Analysis : Use
MlKitAnalyzerinstead of manualImageAnalysis.Analyzer. - Filters and effects : Use
Media3Effectfor standard post-processing. - Multi-camera : Use
ConcurrentCameraAPIs for dual-stream setups.
See modern-apis for current recommendations.
Code quality and architectural rules
Adhere to the following Android ecosystem standard patterns when building your camera implementations:
- Testing, fakes over mocks : Avoid mocking libraries like
Mockito, especially for multi-step CameraX interfaces likeImageProxy. Build "Fakes" to verify state rather than unreliable implementation details. - Google Truth assertions : Use
assertThatover standardJUnitassertions likeassertEqualsfor improved readability. - Explicit test runners : Always define an explicit
@RunWithfor test classes to ensure the CI environment executes them correctly. - Semantic UI merging : When building custom camera controls in Compose, such as a button with an
IconandText, usesemantics { mergeDescendants = true }to ensure screen readers announce them as a single, coherent unit.
Hardware and device diversity
Camera apps run on a wide variety of hardware, from mobile phones and foldables to tablets, laptops, and even smart appliances. Have consideration for the specific hardware the app is running on.
- Form factors: Account for screen size and orientation changes on foldables and tablets.
- Multi-camera arrays: Some devices have a rear-facing camera and a front-facing camera. Other devices have multiple rear-facing cameras, such as wide-angle and telephoto lenses.
- Feature parity: Features like flash or auto-focus behave differently across hardware. For example, CameraX handles both physical flash, back, and screen-based flash, front, and both must be considered when implementing flash functionality.
Common pitfalls
- Asynchronous lifecycles : Check
isRecordingstate before attempting to stop or pause. HandleVideoRecordEvent.Startfor UI state updates, not just the initial call. - Thread safety: Camera callbacks often run on background executors. Dispatch UI updates on the main thread.
- Permission handling : Check
CAMERApermission; check forRECORD_AUDIOspecifically when enabling audio inVideoCapture.
Related Skills
taste-skill
116.8kAgent skills that give coding agents taste: art direction, reference images and a browser check instead of generic AI pages
ai-job-search
72.1kThe job search that runs on your machine. AI job application framework built on Claude Code: evaluate postings, tailor CVs, write cover letters, prep interviews. Fork it and own it.
claude-howto
47.3kA visual, example-driven guide to Claude Code — from basic concepts to advanced agents, with copy-paste templates that bring immediate value.
Claude-Code-Game-Studios
39.7kTurn Claude Code into a full game dev studio — 49 AI agents, 72 workflow skills, and a complete coordination system mirroring real studio hierarchy.
Languages
Trust signals
From repository metadata: license, adoption, age and documentation. Not a code audit — see the Safety scan above for what the skill file itself contains.
