Android has deprecated android.hardware.Camera and now I recommend using android.hardware.camera2, but this is not available in anything below API 21

I have an application that backwards supports Android API 19 (KitKat) , and inside the heavy camera is used internally.

android.hardware.camera2 is currently the recommended way to use the camera API and android.hardware.Camera deprecated .

Is there a way to support API 19 and stop using android.hardware.Camera without receiving a warning in my assembly? If so, how?

The only other question I could find is, but it does not answer my question.

+4
source share
1 answer

would you use

 if(Build.VERSION.SDK_INT < Build.VERSION_CODES.LOLLIPOP) { //use old camera API }else{ //use new camera API } 

then you can support what you want

+6
source

All Articles