Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Why should or shouldn't I use camera2 API in android?

Tags:

android

I have made an android application that uses standard android Camera API to take pictures, however i am having difficulty in implementing manual focus and some other features. I have come across Camera2 API recently and just wanted to know if its worth trying or not?

like image 808
musab shaheed Avatar asked Oct 29 '15 20:10

musab shaheed


1 Answers

On the plus side, the camera2 API is much richer than the original Camera API. I suspect that it will tend to be more stable than the Camera API, as I think Google is taking it more seriously. Conversely, over time, manufacturers are likely to invest less and less engineering and QA time on the old Camera API. By 2018, when Android 5.0+ is 90% of the market, apps should be using the camera2 API exclusively, IMHO, unless the app specifically is aiming at legacy devices.

However:

  • The camera2 API only works on Android 5.0 and higher, so unless your minSdkVersion is 21 or higher, you still need the Camera API for older devices. That means either only using the Camera API or using both (and hence having additional engineering work).

  • IMHO, the documentation for both is severely lacking, but the Camera API has been around longer, so there are more Stack Overflow answers, blog posts, and so on that cover it.

  • To really take advantage of the power of the camera2 API, you need to be a camera enthusiast, IMHO. Personally, I am not, and so a lot of what the camera2 API offers is beyond my comprehension, though I'm sure it's really cool.

like image 74
CommonsWare Avatar answered Oct 19 '22 13:10

CommonsWare