Reputation: 41
In my app android.hardware.camera2 works for api 21 22 but doesn't for lower versions and android.hardware.camera work till api level 20. What should I do to make it work for api level 15-22.
Upvotes: 2
Views: 1738
Reputation: 1006584
and android.hardware.camera work till api level 20
android.hardware.Camera
works on all versions of Android. It is officially deprecated on API Level 21+, but it still works.
What should I do to make it work for api level 15-22.
If "it" is android.hardware.Camera
, it should work fine through API Level 22.
If "it" is android.hardware.camera2.*
, it did not exist prior to API Level 21, and so without a time machine, you have no way of arranging for it to exist before it existed.
If "it" is your app, either use android.hardware.Camera
for all devices, or use it only for the older devices and use android.hardware.camera2.*
for newer devices. As the two APIs are not very similar, this will be a fair amount of work.
Upvotes: 4