camera1-to-camerax

Migrate legacy Android Camera1 or Camera2 code to CameraX.

Updated Jan 11, 2026
One-click install
npx skills add https://github.com/Kaito-Dogi/smopin --skill camera1-to-camerax-kaito-dogi
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: camera1-to-camerax
Source: https://github.com/Kaito-Dogi/smopin/tree/main/.agents/skills/android-skills/camera/camera1-to-camerax
Command: npx skills add https://github.com/Kaito-Dogi/smopin --skill camera1-to-camerax-kaito-dogi

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill requires androidx.camera:camera-core, androidx.camera:camera-camera2, androidx.camera:camera-lifecycle, androidx.camera:camera-view, androidx.camera:camera-compose, and includes scripts (resource) components.

What problem does it solve?

This Skill helps developers migrate legacy Android camera code (Camera1 or raw Camera2 APIs) to the modern CameraX library, which simplifies camera operations and resolves common issues like camera rotation and device dependencies.

Core Features & Use Cases

  • Legacy Camera Code Migration: Converts Camera1 or raw Camera2 APIs to CameraX, leveraging lifecycle-aware design.
  • CameraX Integration: Utilizes CameraX's lifecycle-aware features to manage camera operations in a more robust and efficient manner.
  • Use Case: For an Android app that uses Camera1 for camera operations, this Skill provides a step-by-step guide to migrate to CameraX, improving the app's camera functionality and user experience.

Quick Start

Run the script 'migrate_to_camerax.sh' to begin the process of migrating your Android camera code from Camera1 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 legacy Android Camera1 code to CameraX?

To migrate legacy Android Camera1 code to CameraX, you run the 'migrate_to_camerax.sh' script that transitions your existing camera operations to CameraX's lifecycle-aware design. This process modernizes your camera implementation using Jetpack libraries.

What is the best way to handle camera rotation and device dependencies in Android?

Handling camera rotation and device dependencies is best achieved by migrating to CameraX. This Jetpack library resolves these common legacy issues internally, simplifying camera operations across different Android devices.

Does CameraX work with Jetpack Compose for Android app development?

Yes, CameraX works with Jetpack Compose for Android app development. The migration includes the 'androidx.camera:camera-compose' dependency, allowing you to integrate lifecycle-aware camera operations directly into your Compose UI.

Can I migrate raw Camera2 APIs to CameraX?

Yes, you can migrate raw Camera2 APIs to CameraX. The migration process converts both legacy Camera1 and raw Camera2 APIs into CameraX's lifecycle-aware Jetpack library, simplifying your camera operations.

Why should I migrate my Android camera code to CameraX?

You should migrate your Android camera code to CameraX to leverage its lifecycle-aware design, which manages camera operations more robustly. It resolves common issues like camera rotation and device dependencies found in legacy Camera1 and Camera2 APIs.