In androidmenifest. XML, the following statements are often used:
<Uses-SDK Android: minsdkversion = "4"
Android: targetsdkversion = "10"
Android: maxsdkversion = "10"/>
In default. properties, the following statement is displayed:
Target = Android-10
If you are using eclipse, you may also see the following warning:
Attribute minsdkversion (4) is lower than the project target API level (10)
So what are the differences between the minsdkversion, targetsdkversion, maxsdkversion, and target API level values?
Minsdkversion is easier to understand than maxsdkversion.ProgramIf the API version of the target device is earlier than minsdkversion or later than maxsdkversion, the program cannot be installed. Generally, you do not need to set maxsdkversion.
Targetsdkversion is relatively complex. If this attribute is set, the Android platform will be notified if the API version of the target device is equal to this value during program execution: this program has been fully tested in this version and is no problem. You do not have to enable the compatibility check for this program. That is to say, if the targetsdkversion is the same as the API version of the target device, the running efficiency may be higher.
However, this setting is only a declaration and a notification, and does not have a very substantial effect. For example, a feature in the targetsdkversion SDK version is used, however, this feature is not supported in earlier versions. When you run a program on an API Device of earlier versions, the following error may be reported: Java. lang. verifyerror. That is to say, this attribute will not help you solve compatibility testing problems. You must at least run the program completely in minsdkversion to ensure compatibility. (This problem is really a headache)
In default. properties, the target indicates the version of the API used for compiling.
In summary, the above four values actually apply to different periods:
The target API level is used during compilation to specify the API version (SDK version) used for compilation.
Minsdkversion and maxsdkversion are used when a program is installed. They are used to specify which versions of devices can install the application.
Targetsdkversion is used to improve the running experience of devices of the specified version when the program is running.
These four values are not strictly checked during program compilation. For example, if you set minsdkversion to be greater than maxsdkversion, the system automatically ignores the wrong maxsdkversion.
Refer:
Http://developer.android.com/guide/appendix/api-levels.html
Http://developer.android.com/guide/topics/manifest/uses-sdk-element.html