targetSdkVersion

Easter79
• 阅读 705

关于 <uses-sdk>

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

问题:

  1. 什么是targetSdkVersion
  2. targetSdkVersion有什么用

android:targetSdkVersion An integer designating the API Level that the application targets. ==if not set,the default value equals that given to minSdkVersion==

This attribute informs the system that you have tested against the target version and the system should not enable any compatibility behaviors to maintain your app's forward-compatibility with the target version.

As Android evolves with each new version,some behaviors and even appearances might change.However,if the API level of the platform is higher than the version declared by your app's targetSdkVersion,the system may enable compatibility behaviors to ensure that your app continue to work the way you expect.

There are many compatibility behaviors that the system may enable based on the value you set for this attribute.Serveral of thess behaviors are described by the corresponding platform version in the Build.VERSION_CODE reference.

To maintain your application along with each Android release,you should increase the value of this attribute to match the lastest API level,then thoroughly test your application on the corresponding platform version.(完全看不懂这啥意思啊,为啥我要把targetSdkVersion搞成最新的API level啊,to maintain your application along with each Android relase啥意思啊.)

What is API level?

API Level is an integer value that uniquely identifies the framework API revision offered by a version of the Android platform.

The framework API consists of:

  • A core set of packages and classes
  • A set of XML elements and attributes for declaring a manifest file
  • A set of Intents
  • A set of permissions that applications can request,as well as permision enforcements included in the system

Android和API Level的对应关系

Platrom Version

API Level

VERSON_CODE

Android 6.0

23

M

Android 5.1

22

LOLLIPOP_MR1

Android 5.0

21

LOLLIPOP

Android 4.4W

20

KITKAT_WATCH

Android 4.4

19

KITKAT

Android 4.3

18

JELLY_BEAN_MR2

Android 4.2,4.2.2

17

JELLY_BEAN_MR1

Android 4.1,4.1.1

16

JELLY_BEAN

Android 4.0.3,4.0.4

15

ICE_CREAM_SANDWICH_MR1

Android 4.0,4.0.1,4.0.2

14

ICE_CREAM_SANDWICH

点赞
收藏
评论区
推荐文章
待兔 待兔
5个月前
手写Java HashMap源码
HashMap的使用教程HashMap的使用教程HashMap的使用教程HashMap的使用教程HashMap的使用教程22
Stella981 Stella981
3年前
Appscan的下载安装
1、下载Appscan:http://download2.boulder.ibm.com...2AppScan\_Setup.exe(https://www.oschina.net/action/GoToLink?urlhttp%3A%2F%2Fdownload2.boulder.ibm.com%2Fsar%2FCMA%2FRAA%2F00jq2
Wesley13 Wesley13
3年前
ES权威指南[官方文档学习笔记]
es:http://www.elasticsearch.org/guide/en/elasticsearch/guide/current/searchlite.html(https://www.oschina.net/action/GoToLink?urlhttp%3A%2F%2Fwww.elasticsearch.org%2Fguide%2Fen%
Wesley13 Wesley13
3年前
4. Nginx模块
Nginx官方模块1.ngx\_http\_stub\_status\_modulehttp://nginx.org/en/docs/http/ngx\_http\_stub\_status\_module.html。(https://www.oschina.net/action/GoToLink?urlhttp%3A%2
Stella981 Stella981
3年前
Jenkins+Ansible+Gitlab自动化部署三剑客
JenkinsAnsibleGitlab自动化部署三剑客小中大showerlee2016031113:00Ansible(https://www.oschina.net/action/GoToLink?urlhttp%3A%2F%2Fwww.
Wesley13 Wesley13
3年前
P2P技术揭秘.P2P网络技术原理与典型系统开发
Modular.Java(2009.06)\.Craig.Walls.文字版.pdf:http://www.t00y.com/file/59501950(https://www.oschina.net/action/GoToLink?urlhttp%3A%2F%2Fwww.t00y.com%2Ffile%2F59501950)\More.E
Wesley13 Wesley13
3年前
Android API Level、sdk版本与发行日期 对照表
我们在项目开发过程中,常常需要查看APILevel和sdk版本,来进行一些方法的调用,有时候还需知道对应发布的时间,可以来了解我们最低兼容到的版本是什么时候发布的。在这里贴出来方便以后查看:https://developer.android.com/guide/topics/manifest/usessdkelement.html
Easter79 Easter79
3年前
Swift项目兼容Objective
!456.jpg(http://static.oschina.net/uploads/img/201509/13172704_1KcG.jpg"1433497731426906.jpg")本文是投稿文章,作者:一叶(博客(https://www.oschina.net/action/GoToLink?urlhttp%3A%2F%2F00red
Easter79 Easter79
3年前
The Complete Guide To Rooting Any Android Phone
PhoneWhitsonGordon(https://www.oschina.net/action/GoToLink?urlhttp%3A%2F%2Fwww.lifehacker.com.au%2Fauthor%2Fwhitsongordon%2F)7April,20118:00AMShare(https://ww
Wesley13 Wesley13
3年前
NO.40 敏捷之旅2012年度成都站!
!(http://www.zentao.net/data/upload/201211/ef877fdf9d3c11093ae67415aee35b79.jpg)(https://www.oschina.net/action/GoToLink?urlhttp%3A%2F%2Fwww.zentao.net%2Fdata%2Fupload%2F20121
Easter79
Easter79
Lv1
今生可爱与温柔,每一样都不能少。
文章
2.8k
粉丝
5
获赞
1.2k