An Introduction to CameraX

Gabriel Tanner
AndroidPub
Published in
6 min readJun 3, 2019

--

Photo by Evan Wise on Unsplash

CameraX is a new Jetpack library introduced at Google IO 2019 which was built to help make camera development easier. It provides an easy to use API environment which works across most Android devices with backwards compatibility to Android 5.0 (API Level 21).

Today, we are going to talk about how CameraX solves some of the problems developers were facing with the old camera API and take a look at how we can create our own camera app using CameraX.

How it helps

Now the question remains how CameraX is different from the other camera APIs and how it can help us develop better camera apps. Here are some of the greatest improvements and benefits CameraX provides us with.

Ease of use:

CameraX provides several predefined use cases like a preview, image capture and image analysis which work on almost every device on the market. This allows us developers to focus on the tasks we need to get done instead of spending our time writing basic functionality and managing requirements for different devices.

Consistency across devices:

Managing the consistency across different devices is hard and there is a lot to account for including the aspect ratio, rotation and orientation. CameraX takes care of that basic configuration and…

--

--

Gabriel Tanner
AndroidPub

Android Developer | Web Developer | Part-time Blogger | Catch me at https://gabrieltanner.org/ | Buy me a coffee buymeacoff.ee/gabrieltanner