I'm building an App which is similar to social media where people can share photos and videos like Instagram. That's why Camera is very important for my app. Now camera2 API is confusing me. I want to run my app on API level 11+ . I know camera2 is only available in API level 21+ So, I need to design two APIs one(camera) for older version and second(camera2) for higher version. Problem is that I just started to learn Android and I do not know what is the main difference between these two APIs.
What main features are available in Camera2 API ?
Or Is there any drawback of Old Camera API ?
I need three things in my App.
1- Simple capture photos 2- Burst pictures (To create GIF Image) 3- Simple video recording.
Which Camera API is good for me ?
The android. hardware. camera2 package provides an interface to individual camera devices connected to an Android device. It replaces the deprecated Camera class.
The Camera2 API is the 2nd generation Camera API in Android's camera framework which was introduced back in Android Lollipop. It enables advanced level of camera functionality and exposes to the camera software application.
Full: These devices support all of the major capabilities of Camera API2 and must use Camera HAL 3.2 or higher and Android 5.0 or higher. Level_3: These devices support YUV reprocessing and RAW image capture, along with additional output stream configurations on top of full Camera2 API support.
prop in the /system partition of your Android device, you can enable the Camera2 API functionality. First you'll need a rooted phone, and a method of editing your build. prop file. You can either use a root file explorer app (like ES Explorer) to navigate to the /system partition on your phone and open build.
The old camera API will work fine for #1 and #3; if you're OK with video-resolution GIFs, you can do #2 as well.
You'll need camera2 (and then devices that support fast, full-resolution capture - see the BURST_CAPTURE capability, or any device that supports the FULL hardware level.), if you want bursts at resolutions above ~1080p.
You can probably start with the CameraView unofficial support library, and modify it as needed. It has support for both APIs, selected based on API level of the device.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With