Skip to content

arindamxd/android-camerax

Repository files navigation

Android CameraX

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

Get it on Google Play

Open Source Love License

Overview

CameraX is a Jet-pack support library, built to help you make camera app development easier. It provides a consistent and easy-to-use API surface that works across most Android devices, with backward-compatibility to Android 5.0 (API level 21).

  • Ease of use
  • Consistency across devices
  • New camera experiences

While it leverages the capabilities of camera2, it uses a simpler, uses a case-based approach that is lifecycle-aware. It also resolves device compatibility issues for you so that you don't have to include device-specific code in your codebase. These features reduce the amount of code you need to write when adding camera capabilities to your app.

Lastly, CameraX enables developers to leverage the same camera experiences and features that pre-installed camera apps provide, with as little as two lines of code. CameraX Extensions are optional add-ons that enable you to add effects like Portrait, HDR, Night, and Beauty within your application on supported devices.

Build

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

./gradlew assembleDebug

Test

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 com.arindam.camerax.MainInstrumentedTest class.
  4. Optional: Give the run configuration a name, like test roboelectric or test device

Find this project useful ? ❤️

Support it by clicking the ⭐ button on the upper right of this page. ✌️

TODO

Implement photo editor, live filters and face detection. Add many more features and bug fixes.

Contact - Let's become friends

License

   Copyright (C) 2019 Arindam Karmakar, Android Open Source Project

   Licensed under the Apache License, Version 2.0 (the "License");
   you may not use this file except in compliance with the License.
   You may obtain a copy of the License at

       http://www.apache.org/licenses/LICENSE-2.0

   Unless required by applicable law or agreed to in writing, software
   distributed under the License is distributed on an "AS IS" BASIS,
   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
   See the License for the specific language governing permissions and
   limitations under the License.

Contributing to Advanced Android Training

All pull requests are welcome, make sure to follow the contribution guidelines when you submit pull request.