CameraX Overview
Why CameraX over the old camera APIs.
Why CameraX?
Adding a camera to an Android app used to be painful. The old android.hardware.camera2 API is powerful but extremely verbose, and behaves differently across the thousands of devices in the wild.
CameraX is a Jetpack library that sits on top of Camera2 and gives you a simple, lifecycle-aware, consistent API. In this course you will use CameraX to show a live preview, take photos and record video.
What CameraX Solves
CameraX was designed around three goals:
- Ease of use — far less boilerplate than Camera2.
- Consistency — Google tests it against a large device lab, so quirky devices behave predictably.
- Lifecycle awareness — the camera starts and stops automatically with your screen's lifecycle, so you don't leak the camera.
You describe what you want (a preview, a photo, a video), and CameraX figures out how to do it on the current device.
All lessons in this course
- CameraX Overview
- Showing a Camera Preview
- Taking Photos
- Recording Video