- 浏览: 580176 次
- 性别:
- 来自: 广州
文章分类
- 全部博客 (338)
- 已过时文章(留念用) (39)
- Android学习笔记 (30)
- Android开发指引自译 (100)
- Android NDK文档自译 (23)
- Android设计指引自译 (2)
- xp(ペケピー)&linux(理奈、铃)酱~ (4)
- ui酱&歌词自译~ (9)
- lua酱~ (9)
- 自我反省 (1)
- 羽game计划 (1)
- XSL酱 (2)
- java酱 (3)
- 设计的领悟 (58)
- 涂鸦作品(pixiv) (1)
- ruby酱 (2)
- Objective-C编程语言自译 (2)
- Android开发月报 (6)
- objc酱 (2)
- photoshop (3)
- js酱 (6)
- cpp酱 (8)
- antlr酱 (7)
- Lua 5.1参考手册自译 (11)
- 收藏品 (3)
- 待宵草计划 (4)
- 体验版截图 (1)
最新评论
-
naruto60:
太给力了!!!!我这网打不开Intel官网,多亏楼主贴了连接, ...
使用HAXM加速的Android x86模拟器(和一些问题) -
yangyile2011:
谢谢博主,翻译得很好哦
【翻译】(4)片段 -
ggwang:
牙痛的彼岸:痹!
牙痛的彼岸 -
ggwang:
总结得很简练清晰啊,学习了!
ANTLR学习笔记一:概念理解 -
leisurelife1990:
mk sdd
用git下载Android自带app的源代码
【翻译】(69)uses-sdk元素
see
http://developer.android.com/guide/topics/manifest/uses-sdk-element.html
原文见
http://developer.android.com/guide/topics/manifest/uses-sdk-element.html
-------------------------------
<uses-sdk>
uses-sdk元素
-------------------------------
* syntax:
* 语法:
-------------------------------
<uses-sdk android:minSdkVersion="integer"
android:targetSdkVersion="integer"
android:maxSdkVersion="integer" />
-------------------------------
* contained in:
* 被包含在:
<manifest>
* description:
* 描述:
Lets you express an application's compatibility with one or more versions of the Android platform, by means of an API Level integer. The API Level expressed by an application will be compared to the API Level of a given Android system, which may vary among different Android devices.
让你表达一个应用程序和Android平台的一个或多个版本的兼容性,通过一个API级别整数。应用程序表达的API级别将和一个给定的Android系统的API级别比较,而它可能在不同的Android设备之间有区别。
Despite its name, this element is used to specify the API Level, not the version number of the SDK (software development kit) or Android platform. The API Level is always a single integer. You cannot derive the API Level from its associated Android version number (for example, it is not the same as the major version or the sum of the major and minor versions).
虽然这个元素的名称,它被用于指定API级别,并不是SDK(软件开发工具箱)的版本号或Android平台。API级别总是一个单一的整数。你不可以从它关联的Android版本号中派生出API级别(例如,它不同于主版本号或主次版本号的和)。
For more information, read about Android API Levels and Versioning Your Applications.
想获得更多信息,请阅读关于Android API级别以及版本化你的应用程序。
-------------------------------
Android Market and <uses-sdk> attributes
Android市场和<uses-sdk>属性
Android Market filters the applications that are visible to users, so that users can only see and download applications that are compatible with their devices. One of the ways Market filters applications is by Android version-compatibility. To do this, Market checks the <uses-sdk> attributes in each application's manifest to establish its version-compatibility range, then shows or hides the application based on a comparison with the API Level of the user's Android system version. For more information, see Market Filters.
Android市场过滤对于用户可见的应用程序,使用户只可以看到和下载兼容它们设备的应用程序。市场过滤应用程序的其中一种方式是通过Android的版本兼容性。为了做到这点,市场检查每个应用程序的清单中的<uses-sdk>属性以建立它的版本兼容性范围,然后展示或隐藏应用程序,基于对用户的Android系统版本的API级别的比较。想获得更多信息,参见市场过滤器。
-------------------------------
* attributes:
* 属性:
* 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.
一个整数,它指示应用程序运行所必需的最小API级别。Android系统将阻止用户安装该应用程序,如果系统的API级别低于这个属性中指定的值。你应该总是声明此属性。
-------------------------------
Caution: If you do not declare this attribute, the system assumes a default value of "1", which indicates that your application is compatible with all versions of Android. If your application is not compatible with all versions (for instance, it uses APIs introduced in API Level 3) and you have not declared the proper minSdkVersion, then when installed on a system with an API Level less than 3, the application will crash during runtime when attempting to access the unavailable APIs. For this reason, be certain to declare the appropriate API Level in the minSdkVersion attribute.
警告:如果你不声明此属性,那么系统假设默认值为"1",它指示你的程序兼容所有Android版本。如果你的应用程序不兼容所有版本(例如,它使用API级别3中引入的API)并且你不曾声明合适的minSdkVersion,那么当安装在带有小于3的API级别的系统上时,应用程序将在运行时期间崩溃,当它尝试访问不可用的API时。因此,请确保在minSdkVersion属性中声明合适的API级别。
-------------------------------
* android:targetSdkVersion
An integer designating the API Level that the application targets. If not set, the default value equals that given to minSdkVersion.
一个整数,指示应用程序目标定为的API级别。如果未被设置,那么默认值等于给予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. The application is still able to run on older versions (down to minSdkVersion).
这个属性告诉系统你已经针对该目标版本测试过并且该系统不应该使能任何兼容行为以维持你的应用对目标版本的向后兼容性。该应用程序仍然可以运行在较旧的版本(低至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 app continues to work the way you expect. You can disable such compatibility behaviors by specifying targetSdkVersion to match the API level of the platform on which it's running. For example, setting this value to "11" or higher allows the system to apply a new default theme (Holo) to your app when running on Android 3.0 or higher and also disables screen compatibility mode when running on larger screens (because support for API level 11 implicitly supports larger screens).
当Android伴随每个新版本进化时,一些行为甚至外观可能会改变。然而,如果平台的API级别高于你的应用的targetSdkVersion声明的版本,那么系统可以使能兼容行为以确保你的应用继续以你期望的方式工作。你可以屏蔽这种兼容行为,通过指定targetSdkVersion以匹配它正在运行在的平台的API级别。例如,设置这个值为"11"或更高,会允许系统应用一个新的默认主题(Holo)到你的应用,当运行在Android 3.0或更高,而且还屏蔽屏幕兼容性模式,当它运行在较大的屏幕(因为对API级别11的支持隐式地支持较大的屏幕)。
There are many compatibility behaviors that the system may enable based on the value you set for this attribute. Several of these behaviors are described by the corresponding platform versions in the Build.VERSION_CODES reference.
存在系统可能使能的许多兼容行为,基于你为这个属性设置的值。这些行为中的一些被Build.VERSION_CODES参考中对应的平台版本描述。
To maintain your application along with each Android release, you should increase the value of this attribute to match the latest API level, then thoroughly test your application on the corresponding platform version.
为了维护你的应用程序和每个Android发布版在一起,你应该递增此属性的值以匹配最新的API级别,然后彻底地在对应的平台版本上测试你的应用程序。
Introduced in: API Level 4
引入:API级别4
* android:maxSdkVersion
An integer designating the maximum API Level on which the application is designed to run.
一个整数,指出该应用程序被设计运行所在的最大API级别。
In Android 1.5, 1.6, 2.0, and 2.0.1, the system checks the value of this attribute when installing an application and when re-validating the application after a system update. In either case, if the application's maxSdkVersion attribute is lower than the API Level used by the system itself, then the system will not allow the application to be installed. In the case of re-validation after system update, this effectively removes your application from the device.
在Android 1.5,1.6,2.0,和2.0.1,系统检查这个属性的值,在安装一个应用程序和在一次系统更新后重新验证该应用程序的时候。在其中一种情况下,如果该应用程序的maxSdkVersion属性低于系统自身使用的API级别时,那么系统将不允许应用程序被安装。在系统更新后的重新验证的情况下,它有效地从设备中移除你的应用程序。
To illustrate how this attribute can affect your application after system updates, consider the following example:
为了描述这个属性如何可以在系统更新后影响你的应用程序,请考虑以下示例:
An application declaring maxSdkVersion="5" in its manifest is published on Android Market. A user whose device is running Android 1.6 (API Level 4) downloads and installs the app. After a few weeks, the user receives an over-the-air system update to Android 2.0 (API Level 5). After the update is installed, the system checks the application's maxSdkVersion and successfully re-validates it. The application functions as normal. However, some time later, the device receives another system update, this time to Android 2.0.1 (API Level 6). After the update, the system can no longer re-validate the application because the system's own API Level (6) is now higher than the maximum supported by the application (5). The system prevents the application from being visible to the user, in effect removing it from the device.
一个在它的清单中声明maxSdkVersion="5"的应用程序被发布在Android市场上。一位用户,他的设备正在运行Android 1.6(API级别4),下载并安装该应用。在几星期后,用户收到一个到Android 2.0的空中系统更新(API级别5)。在更新后被安装后,系统检查应用程序的maxSdkVersion并成功地重新验证它。应用程序正常地起作用。然而,一段时间后,设备收到另一个系统更新,这次是升到Android 2.0.1(API级别6)。在更新后,系统可能不再重新验证该应用程序,因为系统自己的API级别(6)现在高于应用程序支持的最大值(5)。系统阻止应用程序对用户可见,事实上从设备中移除它。
-------------------------------
Warning: Declaring this attribute is not recommended. First, there is no need to set the attribute as means of blocking deployment of your application onto new versions of the Android platform as they are released. By design, new versions of the platform are fully backward-compatible. Your application should work properly on new versions, provided it uses only standard APIs and follows development best practices. Second, note that in some cases, declaring the attribute can result in your application being removed from users' devices after a system update to a higher API Level. Most devices on which your application is likely to be installed will receive periodic system updates over the air, so you should consider their effect on your application before setting this attribute.
警告:不建议声明此属性。首先,没有必要设置该属性作为阻碍你的应用程序安装到新版本的Android平台上的方式,当它们被发布时。设计上,新版本的平台完全是向后兼容的。你的应用程序应该在新版本上工作正常,假设它只使用标准API并且遵循开发的最佳实践。其次,注意在一些情况下,声明该属性可以导致在系统升级到一个较高API级别之后你的应用程序从用户设备中被移除。你的应用程序可能打算被安装在的大多数设备将通过无线网络收到周期性系统更新,所以在设置这个属性前你应该考虑它们对你的应用程序的影响。
-------------------------------
Introduced in: API Level 4
引入:API级别4
-------------------------------
Future versions of Android (beyond Android 2.0.1) will no longer check or enforce the maxSdkVersion attribute during installation or re-validation. Android Market will continue to use the attribute as a filter, however, when presenting users with applications available for download.
Android的未来版本(在Android 2.0.1之后)将不再在安装或重新验证期间检查或实施maxSdkVersion属性。然而,Android市场将继续使用该属性作为一个过滤器,当把可用于下载的应用程序展示给用户时。
-------------------------------
* introduced in:
* 引入:
API Level 1
API级别1
Except as noted, this content is licensed under Apache 2.0. For details and restrictions, see the Content License.
除特别说明外,本文在Apache 2.0下许可。细节和限制请参考内容许可证。
Android 4.0 r1 - 14 Feb 2012 21:12
-------------------------------
Portions of this page are modifications based on work created and shared by the Android Open Source Project and used according to terms described in the Creative Commons 2.5 Attribution License.
(此页部分内容基于Android开源项目,以及使用根据创作公共2.5来源许可证描述的条款进行修改)
(本人翻译质量欠佳,请以官方最新内容为准,或者参考其它翻译版本:
* ソフトウェア技術ドキュメントを勝手に翻訳
http://www.techdoctranslator.com/android
* Ley's Blog
http://leybreeze.com/blog/
* 农民伯伯
http://www.cnblogs.com/over140/
* Android中文翻译组
http://androidbox.sinaapp.com/
)
发表评论
-
【翻译】(9-补丁2)电话簿提供者
2012-07-18 12:54 2400【翻译】(9-补丁2)电话簿提供者 see h ... -
【翻译】(8-补丁1)Android接口定义语言(AIDL)
2012-07-02 05:55 2927【翻译】(8-补丁1)Andro ... -
【翻译】(0)应用组件
2012-06-30 23:50 829【翻译】(0)应用组件 see http:// ... -
【翻译】(88)传感器
2012-05-21 21:25 1077【翻译】(88)传感器 ... -
【翻译】(87)复制与粘贴
2012-05-20 14:48 1929【翻译】(87)复制与粘贴 see http: ... -
【翻译】(86)音频捕捉
2012-05-16 15:14 1104【翻译】(86)音频捕捉 ... -
【翻译】(85)照相机
2012-05-13 15:09 3795【翻译】(85)照相机 see http:// ... -
【翻译】(84)JetPlayer
2012-04-21 16:24 981【翻译】(84)JetPlayer see h ... -
【翻译】(83)媒体回放
2012-04-21 16:00 1860【翻译】(83)媒体回放 see http:/ ... -
【翻译】(82)多媒体与照相机
2012-04-18 23:05 953【翻译】(82)多媒体与照相机 see htt ... -
【翻译】(23-补丁3)构建无障碍服务
2012-04-18 21:57 1627【翻译】(23-补丁3)构 ... -
【翻译】(23-补丁2)使应用程序无障碍
2012-04-16 13:08 2099【翻译】(23-补丁2)使应用程序无障碍 see ... -
【翻译】(23-补丁1)无障碍
2012-04-11 22:38 911【翻译】(23-补丁1)无 ... -
【翻译】(81)Renderscript之运行时API参考手册
2012-04-11 22:13 1416【翻译】(81)Renderscript之运行时API参 ... -
【翻译】(80)Renderscript之计算
2012-04-09 14:09 1444【翻译】(80)Renderscript之计算 ... -
【翻译】(79)Renderscript之图形
2012-04-08 13:59 2866【翻译】(79)Renderscript之图形 ... -
【翻译】(78)Renderscript
2012-04-04 15:35 1442【翻译】(78)Renderscript see ... -
【翻译】(77)可绘画对象动画
2012-03-18 10:52 711【翻译】(77)可绘画对象动画 see htt ... -
【翻译】(76)视图动画
2012-03-18 10:04 806【翻译】(76)视图动画 see http:/ ... -
【翻译】(75)属性动画
2012-03-17 18:24 2508【翻译】(75)属性动画 see http:/ ...
相关推荐
在Android应用开发中,`AndroidManifest.xml` 文件是至关重要的,因为它包含了应用程序的元数据,包括对`uses-sdk`标签的定义。`uses-sdk`标签用于指定应用支持的Android SDK版本,这对于应用的兼容性和性能至关重要...
Altium Designer提供了一个名为Altium-SDK(软件开发工具包)的编程接口,允许开发者通过编程方式扩展和定制软件功能。文档"Altium-SDK---Technical-Reference---System-API"是一个技术参考指南,为开发者提供了...
这是CTS测试Rotation Vector CV Crosscheck必须安装的apk Since version 1.7 several packages of OpenCV Manager are built. Every package is targeted for some ...Manager uses built-in version of OpenCV.
建议使用在线的部署方式,非常简单。 首先在项目下的build.gradle(project:....)文件中输入 1 2 3 4 5 6 ... // Add the following ...<uses-permission android:name="android.permission.ACCESS_FINE_LOCATION" />
<uses-permission android:name="android.permission.ACCESS_FINE_LOCATION" /> ``` Mapbox Android SDK提供了丰富的API和工具,开发者可以自定义地图样式,包括更改颜色、字体、图层等。你可以使用Mapbox Studio...
虽然Android没有明确指定uses-permission不可以重复写,但是最近的经验是最好是不要重复,否则在某些厂商定制的技巧可能出现问题。 最近写一个应用,里面有用到网络访问,发现在有些机型下总是访问不了网络。而其他...
百度地图APK源码 <uses-permission android:name=...</uses-permission><uses-permission android:name="android.permission.ACCESS_GPS"/><uses-sdk android:targetSdkVersion="18" android:minSdkVersion="7"/>
Existing code that uses await/yield shall work as it is but with compile time warnings. [osx] IME support (Far East languages input method in particular). [win] support of mouse devices with MOUSE ...
Complete software distribution – Reference code (the API libraries) – Sample system code (BSPs) – Sample applications ...– If a customer uses a different OS, the SDK has to be ported to it
开发者需要了解如何设置`<uses-sdk>`标签以指定最低支持的API级别。 8. **性能优化**:Android 4.0引入了硬件加速渲染,提高了图形性能,开发者需要学习如何利用这一特性提升应用表现。 9. **Intent 和 Intents ...
9. **兼容性**:API级别15的出现,意味着开发者需要考虑如何使应用兼容之前的版本,通过使用`<uses-sdk>`标签指定最小和目标API级别。 10. **开发者文档**:除了SDK本身,Android开发者网站还提供了详细的API参考...
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" /> ``` 4. **初始化SDK**:在应用程序的主Activity的`onCreate`方法中,初始化优米SDK,传入APPID和APPKEY: ```java YoumiConfig....
wechat-cakephp-sdk wechat-cakephp-sdk 在wechat-php-sdk上修改适配cakephp, controller中有使用范例 项目地址: ###更新 Wechat.php中增加适配CakePHP的缓存配置,也可以根据实际情况在WechatCache中改为其他的缓存...
<uses-permission android:name="android.permission.ACCESS_COARSE_LOCATION" /> <uses-permission android:name="android.permission.READ_PHONE_STATE" /> <uses-permission android:name="android.permission....
别代码:<uses-sdk android:minSdkVersion="7" /> <uses-permission android:name="android.permission.CALL_PHONE" /> <uses-permission android:name="android.permission.READ_CONTACTS" /> <uses-permission ...
<uses-permission android:name="android.permission.ACCESS_FINE_LOCATION" /> <uses-permission android:name="android.permission.ACCESS_COARSE_LOCATION" /> <uses-permission android:name="android....
安卓 SDK Poi Android SDK 和显示 SDK 用法的示例 Android 应用程序 安装 将 getPoi_vXXX.jar 文件添加到您的项目中。 将以下权限和定义添加到您的 AndroidManifest.xml 文件中: ... uses-permission androi
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" /> <uses-permission android:name="android.permission.WAKE_LOCK" /> <uses-permission android:name=...
`<uses-feature>` 元素通常包含以下属性: 1. `android:name`:此属性定义了所需功能的名称,它是一个字符串,例如 `"android.hardware.touchscreen.multitouch"` 表示多点触控屏幕。功能名称可以是Android官方定义...