I have an app that uses camera2 API and also the old camera version. The problem is that I need to generate a single APK with minSdkVersion 16 and camera2 does not compile together, for obvious reasons.
I gave a quick fix to the problem by making an exclusive photo app for Camera2. I detect the user's Android version and, if greater than or equal to 5.0 (21), trigger an Intent for this particular app. I could not get an elegant solution to this problem.
So... how can I generate only APK in this case?