CameraX overview   Part of Android Jetpack.

CameraX is a Jetpack library, built to help make camera app development easier. For new apps, we recommend starting with CameraX. It provides a consistent, easy-to-use API that works across the vast majority of Android devices, with backward-compatibility to Android 5.0 (API level 21).

Primary benefits

CameraX improves the developer experience in several key ways.

Broad device compatibility

CameraX supports devices running Android 5.0 (API level 21) and higher, representing over 98% of existing Android devices.

Ease of use

CameraX emphasizes use cases, which allow you to focus on the task you need to get done instead of managing device-specific nuances. Most common camera use cases are supported:

Consistency across devices

Figure 2. Automated CameraX test lab ensures a consistent API experience across many device types and manufacturers.

Maintaining consistent camera behavior is hard. You have to consider aspect ratio, orientation, rotation, preview size, and image size. With CameraX, these basic behaviors just work.

We maintain an automated CameraX test lab that tests a variety of camera behaviors across a range of devices and all operating system versions since Android 5.0. These tests run on an ongoing basis to identify and fix a wide range of issues.

New experiences

Figure 3. An image captured with the bokeh (portrait) effect using CameraX.

CameraX has an optional Extensions API that allows you to access the same features and capabilities as a device's native camera app with as few as two lines of code.

Extensions include bokeh (portrait), high dynamic range (HDR), night mode, and face retouching, all of which require device support.

Case study

To see how CameraX has simplified development for Monzo, see their case study.

Documentation

Additional resources

To learn more about CameraX, consult the following additional resources.

Codelab

  • Getting Started with CameraX
  • Code sample

  • CameraX sample apps