Skip to content
Branch: master
Find file History
owahltinez Fix listener and use case lifecycle management
- Bump CameraX version to 1.0.0-alpha02
- Register display listener every time view is attached (fixes #10, fixes #11)
- Call setTargetRotation on all use cases upon rotation (fixes b/133801410)
- Simplify hasPermissions function (fixes b/133776671)

Change-Id: I2fba0d5139b2b0736861be48c3fa5910965d9b5f
Latest commit 98a77de Jun 4, 2019


CameraXbasic aims to demonstrate how to use CameraX APIs written in Kotlin.


To build the app directly from the command line, run:

./gradlew assembleDebug


Unit testing and instrumented device testing share the same code. To test the app using Roboelectric, no device required, run:

./gradlew test

To run the same tests in an Android device connected via ADB, run:

./gradlew connectedAndroidTest

Alternatively, test running configurations can be added to Android Studio for convenience (and a nice UI). To do that:

  1. Go to: Run > Edit Configurations > Add New Configuration.
  2. For Roboelectric select Android JUnit, for connected device select Android Instrumented Tests.
  3. Select app module and class.
  4. Optional: Give the run configuration a name, like test roboelectric or test device
You can’t perform that action at this time.