Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

What is Android CameraX?

What is Android CameraX?

There is a session about CameraX planned in Google I/O 2019. What is it? Is it a new framework API? Is it a new library? https://events.google.com/io/schedule/events/8d400240-f31f-4ac2-bfab-f8347ef3ab3e

Does it mean that Camera2 API is deprecated? https://github.com/googlesamples/android-Camera2Basic

like image 857
Yuichi Araki Avatar asked Apr 23 '19 02:04

Yuichi Araki


2 Answers

What is Android CameraX?

CameraX is a new Jetpack library that lets developers control a device's camera and focuses on compatibility across devices going back to API level 21 (Lollipop). It was announced at Google I/O 2019 and has a dedicated documentation page alongside an official sample.

Does it mean that Camera2 API is deprecated?

Camera2 API is not deprecated; in fact, it is the foundation that CameraX is built on. CameraX also provides a Camera2 interop API that lets developers extend their CameraX implementation with Camera2 code.

For more information, the official documentation is available at https://developer.android.com/camerax

like image 165
Oscar Wahltinez Avatar answered Nov 18 '22 12:11

Oscar Wahltinez


In Google IO 2019, Google added another powerful tool for camera development in Android development called CameraX as part of Jetpack

Few Features of CameraX

  • It is backwards compatible till Android 5.0 / Lollipop (API 21) and it works with at least 90% devices in the market.
  • Under the hood, it uses and leverages the Camera 2 APIs. It basically, provide the same consistency as Camera 1 API via Camera 2 Legacy layer and it fixed a lot of issues across the device.
  • It also has a lot of awesome advanced features like Portrait, HDR, Night mode etc (Provided your Device supports that).
  • CameraX has also introduced use cases which allow you to focus on the the task you need to get it done and not waste your time with specific devices. Few of them are Preview, Image Analysis, Image Capture.
  • CameraX doesn't have specific call/stop methods in onResume() and onPause() but it binds to the lifecycle of the View with the help of CameraX.bindToLifecycle()
  • The following is the few lists of known issues fixed with CameraX,

enter image description here

what more you can do with CameraX

  • You can also create Video Recorder App using CameraX
  • Add multiple extensions like Portrait Mode, HDR etc.
  • We can also use Image Analysis to perform Computer Vision, ML. So it implements Analyzer method to run on each and every frame.

To read more about CameraX refer here

for Getting Started with CameraX

like image 8
Basi Avatar answered Nov 18 '22 13:11

Basi