コレクションでコンテンツを整理
必要に応じて、コンテンツの保存と分類を行います。
CameraX は、カメラアプリの開発を容易にすることを目的とした Jetpack ライブラリです。
新しいアプリの場合は、CameraX から始めることをおすすめします。ほとんどの Android デバイスで機能する一貫性のある使いやすい API を提供するとともに、Android 5.0(API レベル 21)への下位互換性も備えています。Camera1 からアプリを移行する場合は、Camera1 から CameraX への移行ガイドをご覧ください。
主なメリット
CameraX は、いくつかの主要な方法でデベロッパーのエクスペリエンスを改善します。
幅広いデバイスに対応
CameraX は、Android 5.0(API レベル 21)以降を搭載したデバイス(既存の Android デバイスの 98% 以上)をサポートしています。
使いやすさ
CameraX ではユースケースを重視しています。ユースケースを使用すると、必須のタスクに集中でき、各デバイスの微妙な違いに対処する必要がなくなります。ほとんどの一般的なカメラのユースケースがサポートされています。
デバイス間の一貫性
図 2. CameraX Test Lab の自動化により、さまざまなデバイスタイプおよびメーカー間で一貫性のある API エクスペリエンスを実現できます。
カメラの動作に一貫性を持たせることは困難です。アスペクト比、画面の向き、回転、プレビュー サイズ、画像サイズを考慮する必要があります。CameraX では、こうした基本的な動作に対処します。
Google は Android 5.0 以来、各種のデバイスとすべてのオペレーティング システム バージョンでさまざまなカメラの動作をテストする CameraX Test Lab の自動化を維持しています。これらのテストは継続的に実施されており、さまざまな問題を特定して解決しています。
カメラ拡張機能
図 3. CameraX を使用してボケ(ポートレート)効果でキャプチャした画像。
CameraX にはオプションの Extensions API があり、デバイスのネイティブ カメラアプリと同じ機能を利用できます。しかも、追加するコードはわずか 2 行です。
拡張機能には、ボケ(ポートレート)、ハイ ダイナミック レンジ(HDR)、夜間モード、顔写真加工(いずれもデバイスのサポートが必要)が含まれています。
事例紹介
CameraX によって Monzo の開発がどのように簡略化されたかについては、Monzo の事例紹介をご覧ください。
ドキュメント
参考情報
CameraX について詳しくは、以下の参考情報をご確認ください。
Codelab
CameraX のスタートガイド
コードサンプル
CameraX のサンプルアプリ
このページのコンテンツやコードサンプルは、コンテンツ ライセンスに記載のライセンスに従います。Java および OpenJDK は Oracle および関連会社の商標または登録商標です。
最終更新日 2025-07-26 UTC。
[null,null,["最終更新日 2025-07-26 UTC。"],[],[],null,["# CameraX overview\nPart of [Android Jetpack](/jetpack).\n=====================================================\n\nCameraX is a Jetpack library, built to help make camera app development easier.\nFor new apps, we recommend starting with CameraX. It provides a consistent,\neasy-to-use API that works across the vast majority of Android devices, with\nbackward-compatibility to Android 5.0 (API level 21). If you're migrating an app\nfrom Camera1, see our\n[Camera1 to CameraX migration guide](/training/camerax/camera1-to-camerax). \n[Get started with CameraX](https://codelabs.developers.google.com/codelabs/camerax-getting-started)\n\nPrimary benefits\n----------------\n\nCameraX improves the developer experience in several key ways.\n\n### Broad device compatibility\n\nCameraX supports devices running\n[Android 5.0 (API level 21)](/about/versions/lollipop) and higher,\nrepresenting over 98% of existing Android devices.\n\n### Ease of use\n\nCameraX emphasizes use cases, which allow you to focus on the task you need\nto get done instead of managing device-specific nuances.\nMost common camera use cases are supported:\n\n- [Preview](/training/camerax/preview): View an image on the display.\n- [Image analysis](/training/camerax/analyze): Access a buffer seamlessly for use in your algorithms, such as to pass to ML Kit.\n- [Image capture](/training/camerax/take-photo): Save images.\n- [Video capture](/training/camerax/video-capture): Save video and audio.\n\n### Consistency across devices\n\n**Figure 2.** Automated CameraX test lab ensures a consistent API\nexperience across many device types and manufacturers.\n\nMaintaining consistent camera behavior is hard. You have to consider\naspect ratio, orientation, rotation, preview size, and image size.\nWith CameraX, these basic behaviors just work.\n\nWe maintain an automated CameraX test lab that tests a variety of camera\nbehaviors across [a range of devices](/training/camerax/devices)\nand all operating system versions since Android 5.0. These tests\nrun on an ongoing basis to identify and fix a wide range of issues.\n\n### Camera extensions\n\n**Figure 3.** An image captured with\nthe bokeh (portrait) effect using CameraX.\n\nCameraX has an optional [Extensions](/training/camerax/extensions-api) API that\nallows you to access the same features and capabilities as a device's native\ncamera app with as few as two lines of code.\n\nExtensions include bokeh (portrait), high dynamic range (HDR),\nnight mode, and face retouching, all of which require device support.\n\n### Case study\n\nTo see how CameraX has simplified development for Monzo,\nsee [their case study](/stories/apps/monzo-camerax).\n\nDocumentation\n-------------\n\n- [CameraX architecture](/training/camerax/architecture)\n- [Configuration options](/training/camerax/configuration)\n- [Implement a preview](/training/camerax/preview)\n- [Image analysis](/training/camerax/analyze)\n- [Image capture](/training/camerax/take-photo)\n- [Video capture](/training/camerax/video-capture)\n- [Camera extensions](/training/camerax/extensions-api)\n- [Transform output](/training/camerax/transform-output)\n- [Use case rotations](/training/camerax/orientation-rotation)\n- [Lab-tested devices](/training/camerax/devices)\n\nAdditional resources\n--------------------\n\nTo learn more about CameraX, consult the following additional resources.\n\n### Codelab\n\n\n- [Getting Started with CameraX](https://codelabs.developers.google.com/codelabs/camerax-getting-started)\n\n### Code sample\n\n- \n- [CameraX sample apps](https://github.com/android/camera-samples/)"]]