Agent skill

Camera1 To Camerax

by jameshnsears in jameshnsears/QuoteUnquote

A skill your agent uses to migrate legacy Android camera implementations (Camera1 or raw Camera2 APIs) to CameraX.

Apache-2.0Auto-check passedMobile

Install Camera1 To Camerax

skills CLI
$ npx skills add jameshnsears/QuoteUnquote --skill camera1-to-camerax -a claude-code

Project install by default; add -g for ~/.claude/skills/.

GitHub CLI
$ gh skill install jameshnsears/QuoteUnquote camera1-to-camerax --agent claude-code

Project scope by default; add --scope user for a personal install. Needs GitHub CLI 2.90.0 or later (public preview).

Manual copy
$ git clone --depth 1 https://github.com/jameshnsears/QuoteUnquote.git skills-src && mkdir -p .claude/skills && cp -r skills-src/.agents/skills/camera1-to-camerax .claude/skills/camera1-to-camerax && rm -rf skills-src

Use ~/.claude/skills/ instead of .claude/skills for a personal install. The folder must contain SKILL.md.

Claude Code skills documentation · loads skills from .claude/skills/

Facts

Skill name
camera1-to-camerax
GitHub stars
100
Used in
1 other repo
Token cost
~1.9k tokens
SKILL.md length
321 words
Files
1
Skills in repo
4
Repo updated
First seen
Licence
Apache-2.0

At a glance

A skill your agent uses to migrate legacy Android camera implementations (Camera1 or raw Camera2 APIs) to CameraX.

  • Works in 6 steps: Add Dependencies → Remove Legacy Implementation → Initialize ProcessCameraProvider → …
  • Migrate legacy Android camera implementations (Camera1
  • SKILL.md covers Step 0: Add Dependencies, Step 1: Remove Legacy…, Step 2: Initialize… and Step 3: Implement the Preview…, plus 3 more sections
  • Instructions only: no scripts, shell commands, URLs or credentials in SKILL.md

What it does

Camera1 To Camerax is an agent skill from jameshnsears/QuoteUnquote. Use this skill to migrate legacy Android camera implementations (Camera1 or raw Camera2 APIs) to CameraX. CameraX is a lifecycle-aware Jetpack library built on top of Camera2 that resolves camera rotation issues and handles device dependencies.

Its SKILL.md is about 1.9k tokens, which your agent loads only when the skill is triggered. It is a single SKILL.md file with no bundled scripts.

It sits in Mobile. It works with Android and Gradle. The repository describes itself as: A Quotations / Affirmations App Widget. The licence is Apache-2.0.

When your agent uses it

  • Migrate legacy Android camera implementations (Camera1
  • Raw Camera2 APIs) to CameraX

Example prompts

  • “/camera1-to-camerax”

Workflow steps

6 steps, taken from the step headings in SKILL.md.

  1. Add Dependencies
  2. Remove Legacy Implementation
  3. Initialize ProcessCameraProvider
  4. Implement the Preview \& Tap-to-Focus
  5. Capture Photo
  6. Switch Cameras

What it can do on your machine

Read from SKILL.md and the folder at commit 1e3f3b0. It shows what the files ask for, not the result of running them.

  • Tool permissions

    Pre-approves nothing: there is no allowed-tools line, so your agent's usual permission prompts apply.

    From allowed-tools in the SKILL.md frontmatter.

  • Runs code

    No scripts in the folder and no shell commands in SKILL.md (its code samples are kotlin).

    From the folder's file list and the shell code blocks in SKILL.md.

  • Network

    No URLs in SKILL.md.

    From URLs in SKILL.md, links to its own repository left out.

  • Credentials

    Names no API keys, tokens, secrets or passwords.

    From names ending in _API_KEY, _TOKEN, _SECRET, _KEY or _PASSWORD in SKILL.md.

Context cost

Camera1 To Camerax loads about 1.9k tokens when it runs. Until then it costs about 66 tokens; SKILL.md has 321 words of instructions outside code blocks.

Always · name and description, kept in context so the agent knows when to use it
~66
When it runs · the whole SKILL.md, loaded when a task matches
~1.9k

Estimates: characters ÷ 4, the usual rule of thumb; real counts depend on the model's tokenizer. Scripts and assets cost tokens only if the agent reads them.

Safety

Auto-check passed

The automated check found no risky patterns in SKILL.md.

Automated static check — not a guarantee. Review scripts before installing. It scans the text of SKILL.md for risky patterns (piping downloads into a shell, reading credential files, hidden Unicode, destructive commands); files beside SKILL.md are not scanned.

SKILL.md

The full file from jameshnsears/QuoteUnquote at commit 1e3f3b0, republished under its Apache-2.0 licence (© jameshnsears). 321 words, ~1,939 tokens.

Download SKILL.mdSave it as .claude/skills/camera1-to-camerax/SKILL.md (or your agent's skills folder).
name
camera1-to-camerax
description
Use this skill to migrate legacy Android camera implementations (Camera1 or raw Camera2 APIs) to CameraX. CameraX is a lifecycle-aware Jetpack library built on top of Camera2 that resolves camera rotation issues and handles device dependencies.
license
Complete terms in LICENSE.txt
metadata.author
Google LLC
metadata.last-updated
2026-05-06
metadata.keywords
Android, CameraX, Camera1 Migration, Jetpack Compose, Dependencies, Image Capture, Lifecycle, PreviewView

Step 0: Add Dependencies

Check for and add the required CameraX dependencies. Use version 1.3.0 or higher for interoperability, or version 1.5.0 or higher for Compose extensions.

If you are using a Version Catalog (libs.versions.toml), add the following:

kotlin
[versions]
camerax = "<minimum_version_needed>"

[libraries]
androidx-camera-core = { group = "androidx.camera", name = "camera-core", version.ref = "camerax" }
androidx-camera-camera2 = { group = "androidx.camera", name = "camera-camera2", version.ref = "camerax" }
androidx-camera-lifecycle = { group = "androidx.camera", name = "camera-lifecycle", version.ref = "camerax" }
androidx-camera-view = { group = "androidx.camera", name = "camera-view", version.ref = "camerax" }
androidx-camera-compose = { group = "androidx.camera", name = "camera-compose", version.ref = "camerax" }
<br />

And in your build.gradle.kts (or build.gradle):

kotlin
implementation(libs.androidx.camera.core)
implementation(libs.androidx.camera.camera2)
implementation(libs.androidx.camera.lifecycle)
implementation(libs.androidx.camera.view)
implementation(libs.androidx.camera.compose)
<br />

Without a Version Catalog, fall back to these standard Gradle dependencies:

kotlin
implementation "androidx.camera:camera-core:<minimum_version_needed>"
implementation "androidx.camera:camera-camera2:<minimum_version_needed>"
implementation "androidx.camera:camera-lifecycle:<minimum_version_needed>"
implementation "androidx.camera:camera-view:<minimum_version_needed>"
implementation "androidx.camera:camera-compose:<minimum_version_needed>"
<br />

Step 1: Remove Legacy Implementation

  1. Delete all android.hardware.Camera instances.
  2. Delete SurfaceView and SurfaceHolder.Callback implementations (surfaceCreated, surfaceChanged, surfaceDestroyed).
  3. Remove custom lifecycle handling that opens or releases the camera in onResume or onPause.
  4. Remove manual matrix calculations for orientation.

Step 2: Initialize ProcessCameraProvider

Request the ProcessCameraProvider and bind use cases to the Activity or Fragment lifecycle.

kotlin
val context = LocalContext.current
val lifecycleOwner = LocalLifecycleOwner.current
LaunchedEffect(context, lifecycleOwner) {
  val cameraProviderFuture = ProcessCameraProvider.getInstance(context)
  cameraProviderFuture.addListener({
      val cameraProvider = cameraProviderFuture.get()

      val cameraSelector = CameraSelector.Builder()
        .requireLensFacing(CameraSelector.LENS_FACING_BACK)
        .build()

      val preview = Preview.Builder().build()
      val imageCapture = ImageCapture.Builder()
        .setCaptureMode(ImageCapture.CAPTURE_MODE_MINIMIZE_LATENCY)
        .build()

      cameraProvider.unbindAll() // Unbind before rebinding

      val camera = cameraProvider.bindToLifecycle(
        lifecycleOwner,
        cameraSelector,
        preview,
        imageCapture
      )
      val cameraControl = camera.cameraControl
    }, ContextCompat.getMainExecutor(context)
  )
}
<br />

Step 3: Implement the Preview & Tap-to-Focus

Choose exactly one of the following patterns based on the app's UI toolkit:

Option A: For Android Views (XML Legacy)

Use androidx.camera.view.PreviewView.

1. Set up preview:

kotlin
preview.setSurfaceProvider(previewView.surfaceProvider)
<br />

2. Handle tap-to-focus:

kotlin
val factory = previewView.meteringPointFactory
val point = factory.createPoint(x, y) // x, y from touch event
val action = FocusMeteringAction.Builder(point, FocusMeteringAction.FLAG_AF).build()
cameraControl?.startFocusAndMetering(action)
<br />
Option B: For Jetpack Compose

Use androidx.camera.compose.CameraXViewfinder.

1. Set up preview and SurfaceRequest:

kotlin
var surfaceRequest by remember { mutableStateOf<SurfaceRequest?>(null) }
val preview = remember {
  Preview.Builder().build().apply {
    setSurfaceProvider { request -> surfaceRequest = request }
  }
}
<br />

2. Render viewfinder:

kotlin
surfaceRequest?.let { request ->
  CameraXViewfinder(
    surfaceRequest = request,
    coordinateTransformer = coordinateTransformer,
    modifier = Modifier
  )
}
<br />

3. Handle tap-to-focus in Compose:

kotlin
// Inside your tap gesture handler...
val surfaceCoords = with(coordinateTransformer) { offset.transform() }
val factory = SurfaceOrientedMeteringPointFactory(
  request.resolution.width.toFloat(),
  request.resolution.height.toFloat()
)
val point = factory.createPoint(surfaceCoords.x, surfaceCoords.y)
val action = FocusMeteringAction.Builder(point, FocusMeteringAction.FLAG_AF).build()
cameraControl?.startFocusAndMetering(action)
<br />

4. Update target rotation for Compose:

kotlin
LaunchedEffect(configuration) {
  if (!view.isInEditMode) {
    val rotation = view.display?.rotation ?: Surface.ROTATION_0
    imageCapture.targetRotation = rotation
    preview.targetRotation = rotation
  }
}
<br />

Step 4: Capture Photo

Use the ImageCapture use case to take the picture. The ImageProxy handles rotation directly.

kotlin
imageCapture.takePicture(
  cameraExecutor,
  object : ImageCapture.OnImageCapturedCallback() {
    override fun onCaptureSuccess(image: ImageProxy) {
      val buffer = image.planes[0].buffer
      val bytes = ByteArray(buffer.remaining())
      buffer.get(bytes)
      val bitmap = BitmapFactory.decodeByteArray(bytes, 0, bytes.size)

      // Adjust rotation natively via ImageProxy
      val matrix = Matrix()
      matrix.postRotate(image.imageInfo.rotationDegrees.toFloat())
      if (lensFacing == CameraSelector.LENS_FACING_FRONT) {
        matrix.postScale(-1f, 1f) // Mirror for front camera
      }

      val rotatedBitmap = Bitmap.createBitmap(
        bitmap, 0, 0, bitmap.width, bitmap.height, matrix, true
      )

      // MUST close proxy
      image.close()
    }

    override fun onError(exception: ImageCaptureException) {
      Log.e("CameraX", "Capture failed: ${exception.message}", exception)
    }
  }
)
<br />

Step 5: Switch Cameras

To flip between front and rear cameras, change the CameraSelector and re-trigger the ProcessCameraProvider logic.

kotlin
lensFacing = if (lensFacing == CameraSelector.LENS_FACING_BACK) {
  CameraSelector.LENS_FACING_FRONT
} else {
  CameraSelector.LENS_FACING_BACK
}
<br />

Constraints

  • Don't manage the camera lifecycle manually : Bind the camera to a LifecycleOwner through the ProcessCameraProvider. Avoid manual camera open or close logic in onResume or onPause.
  • Don't calculate focus matrices manually : MeteringPointFactory handles coordinate transformations, including device rotation offsets. Avoid custom matrix implementations.
  • Don't forget to close the ImageProxy : Remember to invoke image.close() in the capture callback. Skipping this call locks the capture pipeline and interrupts subsequent photos.
  • Don't wrap PreviewView in AndroidView for Compose code : For Compose UI layouts, use CameraXViewfinder. Compiling PreviewView in an AndroidView is an old fallback option that introduces resizing issues.

© jameshnsears, Apache-2.0. Rendered from Markdown: HTML in the file is shown as text, images as links, and headings moved down two levels. Raw file

Files

Just SKILL.md in .agents/skills/camera1-to-camerax of jameshnsears/QuoteUnquote.

Open the folder on GitHubat commit 1e3f3b0

Used in 1 other repository

We found 1 copy of this SKILL.md (exact, near-identical or edited) in other folders, from 1 other GitHub owner. This page covers the copy in jameshnsears/QuoteUnquote, which our catalogue first saw on October 7, 2026.

Compare with similar skills

Camera1 To Camerax next to the 5 skills that share the most tags, products or categories with it. Stars are the repository's; “used in” counts other GitHub owners with a copy.

Camera1 To Camerax compared with similar skills
SkillStarsUsed inTokensAuto-checkLicenceRepo updated
Camera1 To Camerax this skilljameshnsears/QuoteUnquote1001 repos~1.9kAutomated safety check: PassApache-2.0
Android API Diffgkd-kit/gkd43k—~796Automated safety check: PassGPL-3.0
Android Developmentdpconde/claude-android-skill336—~1.7kAutomated safety check: PassMIT
Run Jetpack Android Appwordpress-mobile/WordPress-Android3.2k—~886Automated safety check: PassGPL-2.0
Orca Android Emulator Controlstablyai/orca89k—~558Automated safety check: PassApache-2.0
Claude Android NinjaDrjacky/claude-android-ninja124—~5.2kAutomated safety check: PassApache-2.0

Similar skills

  • Android API Diff

    gkd-kit/gkd

    Looks up Android framework Java and AIDL APIs across versions with the android-api-diff CLI: signatures, availability, source files and hidden-API access code.

    43k GitHub stars~796 tokensUpdated today
    MobileAuto-check passed
  • Android Development

    dpconde/claude-android-skill

    Create production-quality Android applications following Google's official architecture guidance and NowInAndroid best practices.

    336 GitHub stars~1.7k tokensUpdated 10 mo ago
    MobileAuto-check passed
  • Run Jetpack Android App

    wordpress-mobile/WordPress-Android

    Builds the Jetpack debug app with Gradle and installs it on a connected Android device or an emulator started from an available AVD.

    3.2k GitHub stars~886 tokensUpdated yesterday
    MobileAuto-check passed
  • Android device and emulator control from inside Orca over adb, with the live device view in Orca's emulator pane. Use when driving an adb-connected emulator…

    89k GitHub stars~558 tokensUpdated today
    MobileAuto-check passed
  • Claude Android Ninja

    Drjacky/claude-android-ninja

    Build and migrate Android apps with Kotlin, Jetpack Compose, MVVM, Hilt, Room 3 (KSP, SQLiteDriver, Flow/suspend DAOs), Navigation3, and multi-module Gradle.

    124 GitHub stars~5.2k tokensUpdated 11 days ago
    MobileAuto-check passed
  • Expo Brownfield Integration

    mweinbach/agent-coworker

    Helps add Expo and React Native to an existing native iOS or Android app, and choose between a prebuilt AAR or XCFramework and a fully integrated build.

    156 GitHub starsUsed in 2 repos~900 tokens
    MobileAuto-check: notes

More from jameshnsears/QuoteUnquote

  • Wear Compose M3

    jameshnsears/QuoteUnquote

    Expert guidance for working with Wear OS Compose Material3. An agent skill from jameshnsears/QuoteUnquote.

    100 GitHub starsUsed in 1 repo~3.2k tokens
    Auto-check passed
  • Perfetto SQL

    jameshnsears/QuoteUnquote

    Translates natural language data intents into syntactically valid Perfetto SQL queries and executes them against a local trace file.

    100 GitHub starsUsed in 2 repos~2.7k tokens
    Auto-check passed
  • Perfetto Trace Analysis

    jameshnsears/QuoteUnquote

    Analyzes Perfetto traces to find the root cause of latency, memory, or jank issues in Android apps.

    100 GitHub starsUsed in 2 repos~1.7k tokens
    Auto-check passed

Works with

Categories

Questions about Camera1 To Camerax

What does Camera1 To Camerax do?

A skill your agent uses to migrate legacy Android camera implementations (Camera1 or raw Camera2 APIs) to CameraX. Camera1 To Camerax is an agent skill from jameshnsears/QuoteUnquote. Use this skill to migrate legacy Android camera implementations (Camera1 or raw Camera2 APIs) to CameraX.

When should I use Camera1 To Camerax?

Camera1 To Camerax fits situations like: migrate legacy Android camera implementations (Camera1; raw Camera2 APIs) to CameraX.

How do I install Camera1 To Camerax in Claude Code?

Run `npx skills add jameshnsears/QuoteUnquote --skill camera1-to-camerax -a claude-code`. Or copy the skill folder (.agents/skills/camera1-to-camerax in jameshnsears/QuoteUnquote) into .claude/skills/camera1-to-camerax in your project. Claude Code loads it when a task matches its description.

How do I install Camera1 To Camerax in Codex?

Run `npx skills add jameshnsears/QuoteUnquote --skill camera1-to-camerax -a codex`. Or copy the skill folder (.agents/skills/camera1-to-camerax in jameshnsears/QuoteUnquote) into .agents/skills/camera1-to-camerax in your project. Codex loads it when a task matches its description.

Can I use Camera1 To Camerax in Cursor, Gemini CLI or GitHub Copilot?

Cursor, Gemini CLI, GitHub Copilot and OpenCode also load SKILL.md folders. With the skills CLI, run `npx skills add jameshnsears/QuoteUnquote --skill camera1-to-camerax -a cursor` (or -a gemini-cli, github-copilot or opencode for the others). To copy it by hand, put the folder in .cursor/skills/camera1-to-camerax, .gemini/skills/camera1-to-camerax, .github/skills/camera1-to-camerax and .opencode/skills/camera1-to-camerax in your project.

What does Camera1 To Camerax need to run?

SKILL.md names no scripts, command-line tools or credentials: Camera1 To Camerax is instructions for the agent only.

Does Camera1 To Camerax access the network?

SKILL.md contains no URLs. Any network use would come from the scripts or tools the agent runs. This is read from the text; nothing was executed.

Is Camera1 To Camerax safe to install?

Our automated static check of SKILL.md found no risky patterns, such as piping downloads into a shell, reading credential files or hidden Unicode. It is not a guarantee. Review the folder before installing.

What licence does Camera1 To Camerax use?

Camera1 To Camerax is published under the Apache-2.0 licence (the repository's licence). It allows redistribution, so the full SKILL.md is shown on this page.

How many tokens does Camera1 To Camerax use?

About 1.9k tokens (SKILL.md is roughly 7.8k characters). Agents keep only the skill's name and description in context until a task matches; then they load SKILL.md in full.

What are the alternatives to Camera1 To Camerax?

Skills that share tags, products or a category with Camera1 To Camerax: Android API Diff (gkd-kit/gkd, 43k stars), Android Development (dpconde/claude-android-skill, 336 stars), Run Jetpack Android App (wordpress-mobile/WordPress-Android, 3.2k stars) and Orca Android Emulator Control (stablyai/orca, 89k stars). The comparison table on this page puts their stars, adoption, token cost, safety result and licence side by side.

Who maintains Camera1 To Camerax?

jameshnsears (a GitHub user) maintains it in jameshnsears/QuoteUnquote, which has 100 GitHub stars. The repository holds 4 skills in this directory. The repository was last updated on August 27, 2026.

Source: jameshnsears/QuoteUnquote on GitHub. Facts on this page come from the repository at the commit we read; the author's words are quoted as theirs.