camera1-to-camerax

Migrate legacy Android Camera1 and Camera2 implementations to CameraX APIs.

Updated Jun 26, 2026
One-click install
npx skills add https://github.com/yash-garg/pi-config --skill camera1-to-camerax-yash-garg
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: camera1-to-camerax
Source: https://github.com/yash-garg/pi-config/tree/main/skills/camera1-to-camerax
Command: npx skills add https://github.com/yash-garg/pi-config --skill camera1-to-camerax-yash-garg

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

This Skill helps developers replace fragile legacy Android camera implementations with CameraX, reducing device compatibility issues, rotation bugs, and manual lifecycle management complexity.

Core Features & Use Cases

  • Camera Migration Guidance: Converts Camera1 and raw Camera2 implementations to lifecycle-aware CameraX architecture.
  • Modern Camera Setup: Provides patterns for dependencies, ProcessCameraProvider, PreviewView, Compose viewfinders, image capture, focus, and camera switching.
  • Use Case: Upgrade an Android app with an outdated camera module to a reliable CameraX implementation that works across devices and integrates with modern Jetpack components.

Quick Start

Use the camera1-to-camerax skill to migrate my existing Android Camera1 or Camera2 implementation to CameraX.

Frequently Asked Questions about camera1-to-camerax

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I migrate my Android Camera1 implementation to CameraX?

Migrating Android Camera1 to CameraX involves replacing legacy Camera1 calls with lifecycle-aware CameraX APIs. This requires setting up dependencies, binding use cases like PreviewView and image capture to the lifecycle, and handling rotation and focus through CameraX APIs.

What is the best way to handle camera lifecycle management when upgrading to CameraX?

The best way to handle camera lifecycle management during a CameraX upgrade is binding camera use cases to the Android lifecycle via ProcessCameraProvider. This eliminates manual lifecycle complexity and prevents device compatibility issues.

Can I use CameraX with Jetpack Compose for my camera preview?

Yes, you can use CameraX with Jetpack Compose. The migration supports creating Compose viewfinders by integrating CameraX APIs with modern Jetpack components to display camera previews reliably across Android devices.

Does CameraX migration support raw Camera2 implementations?

Yes, CameraX migration supports raw Camera2 implementations. It helps developers replace fragile raw Camera2 code with CameraX architecture, satisfying focus handling, rotation management, and capture pipeline requirements through higher-level CameraX APIs.

Why should I modernize my Android camera module to CameraX?

You should modernize your Android camera module to CameraX to reduce device compatibility issues, fix rotation bugs, and remove manual lifecycle management complexity. CameraX provides a reliable, lifecycle-aware architecture that works across Android devices.