【移动开发】targetSdkVersion的作用
在AndroidMenifest.xml中,常常会有下面的语句:
<uses-sdk android:minSdkVersion="4" android:targetSdkVersion="10" android:maxSdkVersion="15" />
在project.properties中,会看到下面的语句: target=android-10 如果是使用Eclipse的话,还可能会看到这样的警告:
Attribute minSdkVersion (4) is lower than the project target API level (10)
那么,这里面的minSdkVersion、maxSdkVersion、targetSdkVersion、target四个属性到底有什么区别?
project.properties中的target是指在编译的时候使用哪个版本的API进行编译。 综上,上面的四个值其实是作用于不同的时期:
这四个数值在程序编译时也没有严格的检查,比如说,你可以将minSdkVersion设置的比maxSdkVersion还大,会自动忽略掉错误的maxSdkVersion。
android:targetSdkVersion
- An integer designating the API Level that the application targets. If not set, the defaultvalue equals that given to
minSdkVersion
.This attribute informs the system that you have tested against the target version and thesystem should not enable any compatibility behaviors to maintain your app's forward-compatibilitywith the target version. The application is still able to run on older versions (down to
minSdkVersion
).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 appcontinues to work the way you expect. You can disable such compatibilitybehaviors by specifyingtargetSdkVersion
to match the APIlevel of the platform on which it's running. For example, setting this value to "11" or higherallows the system to apply a new default theme (Holo) to your app when running on Android 3.0 orhigher and also disables screencompatibility mode when running on larger screens (because support for API level 11 implicitlysupports larger screens).There are many compatibility behaviors that the system may enable based on the value you setfor this attribute. Several of these behaviors are described by the corresponding platform versionsin the
Build.VERSION_CODES
reference.To maintain your application along with each Android release, you should increasethe value of this attribute to match the latest API level, then thoroughly test your application onthe corresponding platform version.
Introduced in: API Level 4
http://developer.android.com/guide/topics/manifest/uses-sdk-element.html
【移动开发】targetSdkVersion的作用的更多相关文章
- C#接口显示实现在实际开发中的作用
摘要 任何一个C#入门的程序员都知道——当一个类型在实现接口的时候,有两种方法实现:显式实现.隐式实现.而且大家也都知道,当一个类型实现的两个接口存在相同成员定义时,显示实现可以解决这种情况. 但是, ...
- Java动态加载类在功能模块开发中的作用
Java中我们一般会使用new关键字实例化对象然后调用该对象所属类提供的方法来实现相应的功能,比如我们现在有个主类叫Web类这个类中能实现各种方法,比如用户注册.发送邮件等功能,代码如下: /* * ...
- VS2017的MVC和Angular联合开发的配置文件作用
在通过MVC和Angular联合开发项目时,项目里有几个重要的配置文件,下面列出这几个配置文件的分析和比较: 主要配置文件有appsettings.json,tsconfig.json,package ...
- JAVA中的垃圾回收机制以及其在android开发中的作用
http://blog.csdn.net/xieqibao/article/details/6707519 这篇文章概述了JAVA中运行时数据的结构,以及垃圾回收机制的作用.在后半部分,描述了如何检测 ...
- 【视频开发】IR-CUT作用
自然界存在着各种波长的光线,通过折射人眼能看到不同颜色的光线,这就是光线的波长不同所导致的.其实还有许多光线是人眼看不到的,人眼识别光线的波长范围在320nm-760nm之间,超过760nm的光线人眼 ...
- 千位分隔符在web开发中的作用
有千位分隔符会被认为是数字,否则在移动端会被直接识别成手机号 在开发实战中主流实现方式是添加meta标签 <meta name="format-detection" cont ...
- [Unity3D]Unity3D游戏开发MatchTarget的作用攀登效果实现
大家好,我是秦培,欢迎关注我的博客.我的博客地址blog.csdn.net/qinyuanpei. 今天我们来一起学习在Unity3D中怎样实现角色攀爬效果. 在RPG游戏中,某些游戏场景经常须要玩家 ...
- 如何选择 compileSdkVersion, minSdkVersion 和 targetSdkVersion
对这几个概念模模糊糊,看到一篇文章就记录下来. 当你发布一个应用之后,(取决于具体的发布时间)可能没过几个月 Android 系统就发布了一个新版本.这对你的应用意味着什么,所有东西都不能用了?别担心 ...
- compileSdkVersion, minSdkVersion 和 targetSdkVersion的选择(copy)
英文原文:Picking your compileSdkVersion, minSdkVersion, and targetSdkVersion 作者:Ian Lake,Google Android ...
随机推荐
- IndentationError : expected an indented block
IndentationError:在python的条件语句出现 expected an indented block问题 是指缩进问题,比如for循环里面的print前面需要四个空格. Python语 ...
- pyspider爬取TripAdvisor
#!/usr/bin/env python # -*- encoding: utf-8 -*- # Created on 2017-06-11 10:10:53 # Project: london f ...
- ASP.NET MVC5 使用NPOI导出ExceL 返回浏览器下载
一,什么是NPOI 该项目是位于http://poi.apache.org/的POI Java项目的.NET版本.POI是一个开源项目,可以帮助您读取/写入xls,doc,ppt文件.它有着广泛的应用 ...
- java中的引用传递问题
---恢复内容开始--- 第一个引用传递案例: class Message{ private int num; public Message(int num){ this.num=num; } pub ...
- 使用Docker安装Jenkins
Jenkins Jenkins是一个开源软件项目,是基于Java开发的一种持续集成工具,用于监控持续重复的工作,旨在提供一个开放易用的软件平台,使软件的持续集成变成可能. 环境准备 腾讯云 硬件配置: ...
- AXIOS源代码重点难点分析
摘要 vue使用axios进行http通讯,类似jquery/ajax的作用,类似angular http的作用,axios功能强大,使用方便,是一个优秀的http软件,本文旨在分享axios源代码重 ...
- [USACO 04OPEN]MooFest
Description 约翰的N 头奶牛每年都会参加“哞哞大会”.哞哞大会是奶牛界的盛事.集会上的活动很多,比如堆干草,跨栅栏,摸牛仔的屁股等等.它们参加活动时会聚在一起,第i 头奶牛的坐标为Xi,没 ...
- codefroces 911G Mass Change Queries
题意翻译 给出一个数列,有q个操作,每种操作是把区间[l,r]中等于x的数改成y.输出q步操作完的数列. 输入输出格式 输入格式: The first line contains one intege ...
- AtCoder Grand Contest 021 D - Reversed LCS
Description Takahashi has decided to give a string to his mother. The value of a string T is the len ...
- Python paramik
本节内容 paramiko模块 1.paramiko模块 Python的paramiko模块,该模块机遇SSH用于连接远程服务器并执行相关操作 Python的paramiko模块,该模块机遇SSH用于 ...