Register now for Android Dev Summit 2019!

CameraX

CameraX is an addition to Android Jetpack that makes it easier to add camera capabilities to your app. The library provides a number of compatibility fixes and workarounds to help make the developer experience consistent across many devices.

For information on how to use the CameraX library in your app or library, see CameraX Overview.

Declaring dependencies

To add a dependency on CameraX, you must add the Google Maven repository to your project. Read Google's Maven repository for more information.

Add the following to each module’s build.gradle file:

dependencies {
  // CameraX core library
  def camerax_version = "1.0.0-alpha03"
  implementation "androidx.camera:camera-core:$camerax_version"
  // If you want to use Camera2 extensions
  implementation "androidx.camera:camera-camera2:$camerax_version"
}

Version 1.0.0-alpha03

July 2, 2019

androidx.camera:camera-core:1.0.0-alpha03 and androidx.camera:camera-camera2:1.0.0-alpha03 are released. The commits included in this version can be found here.

API Changes

  • Removed CameraView.setQuality call
  • Renamed CameraView.setCameraByLensFacing to setCameraLensFacing for use as Kotlin property
  • Added javadoc clarification for “target” in setTarget configuration calls

Camera-Core

  • Fixed unconfigured Input/Output Surface crash on rapid open/close or bind/unbind
  • Move to new Futures implementations
  • Test fixes for more robust testing
  • Core integration test now shows capture time for photos
  • Developed internal compat class for Executors
  • Timing test app capture images waits for previous to complete & improved stability

Extensions

  • Added versioning checks
  • Additional test coverage - extension event callbacks
  • Improvements for internally corresponding image and meta-data
  • Fixes to mode switching in test app

Version 1.0.0-alpha02

June 5, 2019

androidx.camera:camera-core:1.0.0-alpha02 and androidx.camera:camera-camera2:1.0.0-alpha02 are released. The commits included in this version can be found here.

Bug fixes

  • Fixed div by zero issue when using emulator
  • Fixed NullPointerException/Surface Abandoned error occurring on some devices when quickly taking photos while unbinding and rebinding use cases rapidly.
  • Fixed internal issue to ensure capture request updates affect all surfaces consistently
  • Stability improvements when restarting use cases in new app instances
  • Internal architecture changes to prepare for supporting executors in the API
  • Additional Javadoc clarifications on CameraX class and lifecycle management
  • Added instrumented testing for Antelope performance test app
  • Remove need for '-keepattributes Signature' in app Proguard config

Version 1.0.0-alpha01

May 7, 2019

androidx.camera:camera-core:1.0.0-alpha01 and androidx.camera:camera-camera2:1.0.0-alpha01 are released. The commits included in this version are available here.