Backward Compatibility for Applications 翻译.docxVIP

  1. 1、本文档共7页,可阅读全部内容。
  2. 2、原创力文档(book118)网站文档一经付费(服务费),不意味着购买了该文档的版权,仅供个人/单位学习、研究之用,不得用于商业用途,未经授权,严禁复制、发行、汇编、翻译或者网络传播等,侵权必究。
  3. 3、本站所有内容均由合作方或网友上传,本站不对文档的完整性、权威性及其观点立场正确性做任何保证或承诺!文档内容仅供研究参考,付费前请自行鉴别。如您付费,意味着您自己接受本站规则且自行承担风险,本站不退款、不进行额外附加服务;查看《如何避免下载的几个坑》。如果您已付费下载过本站文档,您可以点击 这里二次下载
  4. 4、如文档侵犯商业秘密、侵犯著作权、侵犯人身权等,请点击“版权申诉”(推荐),也可以打举报电话:400-050-0827(电话支持时间:9:00-18:30)。
查看更多
Backward Compatibility for Applications 翻译

Backward Compatibility for Applications应用的向后兼容A variety of Android-powered devices are now available to consumers from carriers in geographies around the world. Across those devices, a range of Android platform versions are in use, some running the latest version of the platform, others running older versions. As a developer, you need to consider the approach to backward compatibility that you will take in your application — do you want to allow your application to run on all devices, or just those running the latest software? In some cases it will be useful to employ the newer APIs on devices that support them, while continuing to support older devices. 一种android-powered设备现在可以被全世界各地的消费者使用。通过这个设备,一系列的android平台版本正在被使用,一些运行着最新的平台版本,另一些运行着比较老的版本。作为一个开发者,你需要为你的应用考虑一个向后兼容的途径,你想让你的应用能跑在所有的设备上,还是只能跑那些最新的软件?在一些情形下,在支持他们的设备上使用比较新的APIs对于继续支持较老的设备是相当有用的。Setting the minSdkVersionIf the use of a new API is integral to the application — perhaps you need to record video using an API introduced in Android 1.5 (API Level 3) — you should add a android:minSdkVersion to the applications manifest, to ensure your app wont be installed on older devices. For example, if your application depends on an API introduced in API Level 3, you would specify 3 as the value of the minimum SDK version:? manifest? ?...? ?uses-sdkandroid:minSdkVersion=3/? ?...? /manifestHowever, if you want to add a useful but non-essential feature, such as popping up an on-screen keyboard even when a hardware keyboard is available, you can write your program in a way that allows it to use the newer features without failing on older devices.Using reflectionSuppose theres a simple new call you want to use, like android.os.Debug.dumpHprofData(String filename). The Debug class has existed since Android 1.0, but the method is new in Anroid 1.5 (API Level 3). If you try to call it directly, your app will fail to run on devices running Android 1.1 or earlier.The simplest way to call the method is through reflection. This requ

文档评论(0)

xy88118 + 关注
实名认证
文档贡献者

该用户很懒,什么也没介绍

1亿VIP精品文档

相关文档