Android Developers Blog
The latest Android and Google Play news for app and game developers.
Platform Android Studio Google Play Jetpack Kotlin Docs News

28 δΈ‰ζœˆ 2022

The exciting aspects of Android Camera

Link copied to clipboard

Posted by Marwa Mabrouk, Android Camera Platform Product Manager

hand holding a phone 

Android Camera is an exciting space. Camera is one of the top reasons consumers purchase a phone. Android Camera empowers developers today through different tools. Camera 2 is the framework API that is included in Android since Android 5.0 Lollipop, and CameraX is a Jetpack support library that runs on top of Camera 2, and is available to all Android developers. These solutions are meant to complement each other in addressing the needs of the Android Camera ecosystem.

For developers who are starting with Android Camera, refreshing their app to the latest, or migrating their app from Camera 1, CameraX is the best tool to get started! CameraX offers key benefits that empower developers, and address the complexities of the ecosystem.

  1. Development speed was the main driver behind CameraX design. The SDK doesn’t just allow developers to get up and running much faster, it also has built in the best of development practices and photography know-how to get the most out of the camera.
  2. Android-enabled devices come in large numbers with many variations. CameraX aims to be consistent across many Android devices and has taken that complexity upon itself, to offer developers an SDK that works consistently across 150+ phone models, with backward-compatibility to Android 5.0 (API level 21). CameraX is tested daily by Google on each of those devices in our labs, to ensure complexity is not surfaced to developers, while keeping the quality high.
  3. Fast library releases is a flexibility that CameraX gets as a Jetpack support library. CameraX launches can happen on shorter regular bases, or ad hoc, to address feedback, and provide new capabilities. We plan to expand on this more in another blog post.

For developers who are building highly specialized functionality with Camera for low level control of the capture flow, and where device variations are to be taken into consideration, Camera 2 should be used.

Camera 2 is the common API that enables the camera hardware on every Android device and is deployed on all the billions of Android devices around the world in the market today. As a framework API, Camera 2 enables developers to utilize their deep knowledge of photography and device implementations. To ensure the quality of Camera 2, device manufacturers show compliance by testing their devices. Device variations do surface in the API based on the device manufacturer's choices, allowing custom features to take advantage of those variations on specific devices as they see fit.

To understand this more, let’s use an example. We’ll compare camera capture capabilities. Camera 2 offers special control of the individual capture pipeline for each of the cameras on the phone at the same time, in addition to very fine grained manual settings. CameraX enables capturing high-resolution, high-quality photos and provides auto-white-balance, auto-exposure, and auto-focus functionality, in addition to simple manual camera controls.

Considering application examples: Samsung uses the Camera Framework API to help the advanced pro-grade camera system to capture studio-quality photos in various lightings and settings on Samsung Galaxy devices. While the API is common, Samsung has enabled variations that are unique to each device's capabilities, and takes advantage of that in the camera app on each device. The Camera Framework API enables Samsung to reach into the low level camera capabilities, and tailor the native app for the device

Another example, Microsoft decided to integrate CameraX across all productivity apps where Microsoft Lens is used (i.e. Office, Outlook, OneDrive), to ensure high quality images are used in all these applications. By switching to CameraX, the Microsoft Lens team was able not only to improve its developer experience in view of the simpler API, but also improve performance, increase developer productivity and reduce time to go to market. You can learn more about this here.

This is a very exciting time for Android Camera, with many new features on both APIs:

  • CameraX has launched several features recently, the most significant has been Video Capture which became available to developers in beta on Jan 26th.
  • With Android 12 launch, Camera 2 has a number of features now available.

As we move forward, we plan to share with you more details about the exciting features that we have planned for Android Camera. We look forward to engaging with you and hearing your feedback, through the CameraX mailing list: and the AOSP issue tracker.

Thank you for your continued interest in Android Camera, and we look forward to building amazing camera experiences for users in collaboration with you!