最小的Andr​​oid SDK版本与目标SDK版本版本、最小、目标、oid

2023-09-11 10:39:22 作者:追逐我的未来

当谈到为Android开发应用程序,什么是民与目标SDK版本之间的区别是什么? Eclipse将不会让我创建一​​个新的项目,除非Min和目标的版本是一样的!

解决方案   

安卓的minSdkVersion

这是整数指定所需的应用程序运行的最小API级别。而Android系统将prevent用户从安装该应用程序,如果系统的API级别比该属性指定的值。你应该总是声明这个属性。

  

安卓targetSdkVersion

一个整数,指定API级别的应用目标定位。

通过这个属性设置,应用程序说,这是可以在旧版本上运行(向下的minSdkVersion),但被明确地测试了此处指定的版本一起工作。指定此目标版本允许禁用不需要的目标版本或启用新的功能,是不可用的旧的应用程序(否则可能会为了保持向前兼容打开)兼容设置的平台。这并不意味着可以编程不同功能的不同版本的平台,它简单地通知你已经测试针对目标版本和平台不应执行任何额外的工作,以保持与目标版本向前兼容的平台。

有关详细信息,请参阅本网址:

http://developer.android.com/guide/topics/manifest/uses-sdk-element.html

When it comes to developing applications for Android, what is the difference between Min and Target SDK version? Eclipse won't let me create a new project unless Min and Target versions are the same!

解决方案

android:minSdkVersion

An integer designating the minimum API Level required for the application to run. The Android system will prevent the user from installing the application if the system's API Level is lower than the value specified in this attribute. You should always declare this attribute.

android:targetSdkVersion

An integer designating the API Level that the application is targetting.

With this attribute set, the application says that it is able to run on older versions (down to minSdkVersion), but was explicitly tested to work with the version specified here. Specifying this target version allows the platform to disable compatibility settings that are not required for the target version (which may otherwise be turned on in order to maintain forward-compatibility) or enable newer features that are not available to older applications. This does not mean that you can program different features for different versions of the platform—it simply informs the platform that you have tested against the target version and the platform should not perform any extra work to maintain forward-compatibility with the target version.

For more information refer this URL:

http://developer.android.com/guide/topics/manifest/uses-sdk-element.html