本系列文章均为A2BGeek原创,转载务必在明显处注明:
转载自A2BGeek的【Android每周专题】系列,原文链接:http://blog.csdn.net/a2bgeek/article/details/8203583
maxSdkVersion和minSdkVersion
1、maxSdkVersion
程序被安装的时候,如果目标设备的API版本大于maxSdkVersion,程序将无法安装;或者手机OTA升级后都需要检查升级前已有的程序,如果程序的maxSdkVersion小于手机当前的API版本,那么将被删除。官方文档的原话是:In either case, if the application's maxSdkVersion
attribute is lower than the API Level used by the system itself, then the system will not allow the application to be installed. In the case of re-validation after system update, this effectively removes your application from the device.
细心的开发者也许会发现,升级过SDK之后(我的是4.3的SDK),新创建的应用程序已经没有这个属性了,为什么呢?
首先,新版本的系统是完全向后兼容的,你没有必要设置这个属性去阻止你的程序安装在新平台上。http://developer.android.com/guide/topics/manifest/uses-sdk-element.html#ApiLevels