Introduction of CameraX
As we know that Google has Announced new things at Google I/O 2019 and CameraX is one of it. As an Android application developer, you have to deal with so many complex things and To work with Camera is always a complex thing for a developer. 😓🤯
To reduce the complexity and make it easy for the developer to deal with camera Google has come up with the new Android library is called CameraX. This is the library which is developed by the Developer for the developer.
So lets Start… 🚩🚩🚩
What is CameraX?
CameraX is a Jetpack 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).
- The CameraX is in alpha stage, as its API surfaces aren’t yet finalized.
- It uses the capabilities of camera2.
- It is lifecycle-aware library.
- CameraX handles all the devices, You don’t have to code for device-specific.
What are the benefits of using CameraX?
- Ease of use: It provides basic use-case like Image Preview, Image analysis, and Image Capture.
- Consistency across devices
- New camera experiences
CameraX structure
Developers use CameraX to interface with a device’s camera through an abstraction called a use case. The following use cases are currently available:
- Preview: prepares a preview SurfaceTexture
- Image analysis: provides CPU-accessible buffers for analysis, such as for machine learning
- Image capture: captures and saves a photo
Lastly, CameraX enables developers to leverage the same camera experiences and features that preinstalled 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.
Explore more about CameraX here 👇
CameraX Documentation👇
Thank you very much for reading! 🙂🙏🙏
If you found this story useful, don’t forget to press 👏 button and share it with other people so they can enjoy it as well.
Follow me on Twitter