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?
Asked
Active
Viewed 332 times
0
-
1depends on your needs (prolly you wana show some preview) so make a common interface inside PreviewFragmentImplBase then `if(API < 21) { usePreviewFragmentImplBase } else {usePreviewFragmenImpl22 }` ... – Selvin Nov 06 '15 at 10:39
-
android studio will not require to change version to 21 if I'll use this class? – Ilya Ilin Nov 06 '15 at 10:44
-
1[which one?](http://developer.android.com/guide/topics/manifest/uses-sdk-element.html) or buildSDK? in gradle ... you can always build with the newest SDK version but you have to do checks if you are using newest API on old platform ... thats how the compat library is builded – Selvin Nov 06 '15 at 10:46
-
Thanks, you can add it as answer – Ilya Ilin Nov 06 '15 at 11:10