Search code examples
androidcompatibility

Dis-allow installation on specific API Level


How to dis-allow my app to run on a specific API level? i know about the 3 specifiers in uses-sdk tag in the manifest. But that can't produce a logic i want to implement.

For eg: i want to allow my application to be installed on Level 4 to Level 10, dis-allow for Level 11 to Level 13 and again allow for Level 14 and Level 15.

Is that possible?


Solution

  • You can do that when you publish it to the Google Play. In Android Developer Console while uploading application come to APK files tab and check advanced mode. It lets you to upload 2 apk files with different sdk levels ranges. But don't forget to set different version codes for them.

    All statistics in the console will be aggregated for both apk files as it is one.