I would like to use camera2
, because it have features that we want. But it's important to stay compatible with <21 API versions. So, I have CameraActivity
and CameraController
classes that using Camera
. Is it possible to use android.hardware.Camera
on old devices and android.hardware.camera2
on new?
Yes. You can use numerous SDK versions as you like.
<uses-sdk android:minSdkVersion="integer"
android:targetSdkVersion="integer"
android:maxSdkVersion="integer" />
edit: Credit to selvin also. While I was searching for this, he beat me to it!