Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Should I use Camera2 or Camera APIs for Android?

Tags:

android

camera

Android released a new version of Camera APIs called camera2, I want to use them on my app since I had a lot of issue with the old APIs and I hope that the new camera management APIs are better. The problem I have the majority of users on older Android devices, is there any compatibility package to handle this for you or do you have to write two different classes for each APIs?

like image 452
Jimmy Avatar asked Mar 17 '23 14:03

Jimmy


1 Answers

is there any compatibility package to handle this for you

No, because that's not really possible -- Camera2 is different at a very low level. If anything, the old android.hardware.Camera API is the "compatibility package".

do you have to write two different classes for each APIs?

I suspect that it will be many more than two different classes. But, yes, if you want to use both APIs, you will need to use both APIs.

like image 90
CommonsWare Avatar answered Apr 04 '23 03:04

CommonsWare