问题
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?
回答1:
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.
回答2:
You can create two apks (Not advisable). One that support for api level 4 to 10 & another one for api level 14 & 15 and you need to activate both the apks in your developer console. The Play store decide which apk to install based on android manifest xml.
来源:https://stackoverflow.com/questions/11498591/dis-allow-installation-on-specific-api-level