targetSdkVersion

关于 <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

点赞
收藏

评论区

加载中...

相关推荐

手写Java HashMap源码

HashMap的使用教程HashMap的使用教程HashMap的使用教程HashMap的使用教程HashMap的使用教程22

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

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%

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

Jenkins+Ansible+Gitlab自动化部署三剑客

JenkinsAnsibleGitlab自动化部署三剑客小中大showerlee2016031113:00Ansible(https://www.oschina.net/action/GoToLink?urlhttp%3A%2F%2Fwww.

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