How to use Android's camera or camera2 API to support old and new API versions without deprecation notes?
Asked 07 September, 2021
Viewed 785 times
  • 59
Votes

The new camera2 API confuses me. I want to develop an app (for Android APIs 10 - 21) which uses the device's camera. As stated here, I should use the "Camera" API.

However, when I try to add the "Camera" API (android.hardware.Camera) to the manifest's user features, it is marked as deprecated. On the other hand, I cannot change it to the "camera2" API (android.hardware.camera2) since it is only compatible with Android API 21+ (Android 5 - Lollipop) - Would have linked it too, but I can only add 2 links.

Not only do I want my app to run on older versions of Android, but also the newest one...

7 Answer