官方英文文档链接:https://source.android.com/compatibility/overview.html
Compatibility Program Overview
兼容性方案概览
The Android compatibility program makes it easy for mobile device manufacturers to develop compatible Android devices.
安卓的兼容性方案让安卓手机生产商能够很容易就开发中可兼容的安卓设备(天地会珠海分舵注:可兼容什么呢?就是可以兼容标准google提供的安卓系统可以支持的功能,以防手机生产商把开源的安卓系统修改得面目全非后,开发者开发的应用都安装不上了,所以才有了CTS来要求手机开发上必须测试通过才能上google play)。
The Android compatibility program works for the benefit of the entire Android community, including users, developers, and device manufacturers.Each group depends on the others. Users want a wide selection of devices and great apps; great apps come from developers motivated by a large market for their apps with many devices in users' hands; device manufacturers rely on a wide variety of great apps to increase their products' value for consumers.
安卓的兼容性方案兼顾了整个安卓社区各个团体的利益,包括用户,开发人员和手机生产商。其中这些团体之间互相依赖,用户希望在广大范围内对手机类型和优秀应用进行选择;而优秀的应用的开发者又会受到一个广大的市场所激励而去开发出更多优秀的应用,因为他们的应用可以通过这个广大的市场到达使用不同类型手机的用户手上;而设备生产商又依赖这些广泛的优秀的应用来提升它们的产品对用户的价值。(天地会珠海分舵注:其实整一段话google的意义就是想表达我的google play是一个多么强大的应用市场。你安卓设备生产商设备想赚钱,想更多的开发者可以开发适合你的机型的应用,想更多的用户使用你的手机,那么你就要用我的google play,而你要用我的google play,那么你阉割修改后的安卓操作系统就必须满足一定的规则,不然用户在我的google play下载了个应用到你手上竟然用不了就对大家都没有好处了)
Our goals were designed to benefit each of these groups:
我们的目的是为了让以下这部分人受惠而设计的:
Provide a consistent application and hardware environment to application developers. Without a strong compatibility standard, devices can vary so greatly that developers must design different versions of their applications for different devices. The compatibility program provides a precise definition of what developers can expect from a compatible device in terms of APIs and capabilities. Developers can use this information to make good design decisions, and be confident that their apps will run well on any compatible device.
为应用开发人员提供一个一致的应用开发环境和硬件环境:如果没有一个兼容性标准的话,各种设备将会五花八门,而开发人员就必须为每个不同的设备开发不同版本的应用。兼容性方案以一套预先规定好的APIs和capabilities(天地会珠海分舵注:capabilities可以理解成手机的一些特性)的形式为开发人员预期能从一个兼容性设备可以获得的功能提供了一个精准的定义。这样开发人员就可以利用这些信息来很好的对如何设计他们的应用做一个决定,且这样他们就非常有信心他们开发的应用可以在任何兼容的设备上良好的运行。
Enable a consistent application experience for consumers. If an application runs well on one compatible Android device, it should run well on any other device that is compatible with the same Android platform version. Android devices will differ in hardware and software capabilities, so the compatibility program also provides the tools needed for distribution systems such as Google Play to implement appropriate filtering. This means users see only the applications they can actually run.
为消费者提供一个一致的应用体验:如果一个应用在一个兼容性设备上可以很好的运行,那么它就应该可以在所有同安卓版本的兼容性设备上很好的运行。各种安卓设备无论在硬件和软件特性上都会有所不同,所以这个兼容方案会为如Google Player等的各种应用分发平台提供相应的工具来开发对应的过滤功能,什么意思呢?意思就是用户在该分发平台上只会看到他们的手机可以运行的应用。
Enable device manufacturers to differentiate while being compatible. The Android compatibility program focuses on the aspects of Android relevant to running third-party applications, which allows device manufacturers the flexibility to create unique devices that are nonetheless compatible.
让设备生产商可以在可兼容的同时又可独树一帜:安卓的兼容性方案关注的方面是安装在设备上的安卓系统是否可以很好的运行第三方应用(天地会珠海分舵注:除生产商自己提供的应用外的第三方应用),这就允许设备生产商在考虑到兼容性的同时怎么创建一个独特的别具一格的的设备提供了很大的弹性空间(天地会珠海分舵注:因为手机生产商只需要保证能满足安卓的兼容性方案,那么就可以对设备做任何其他的事情了)
Minimize costs and overhead associated with compatibility. Ensuring compatibility should be easy and inexpensive to device manufacturers. The testing tool is free, open source, and available for download. It is designed to be used for continuous self-testing during the device development process to eliminate the cost of changing your workflow or sending your device to a third party for testing. Meanwhile, there are no required certifications, and thus no corresponding costs and fees.
最小化兼容性所带来的附加成本:保证设备的兼容性对设备生产商来说应该是很容易且不昂贵的事情。安卓兼容性方案提供的工具是免费的,开源的,可下载的。它设计出来本身就是为了让设备生产商在在设备开发过程中进行持续的自测,这样设备生产商就可以消除开发流程变化或者把设备送到第三方机构进行兼容性检测所带来的附加成本。同时,安卓兼容性方案不需要任何的认证,所以不会产生相应的费用和账单。
The Android compatibility program consists of three key components:
安卓兼容性方案由以下3个关键部分组成:
Just as each version of the Android platform exists in a separate branch in the source code tree, there is a separate CTS and CDD for each version as well. The CDD, CTS, and source code are -- along with your hardware and your software customizations -- everything you need to create a compatible device.
正如不同版本的安卓平台的源码会从源码树中分出不同的对应的分支一样,不同版本的CTS和CDD也会有不同的分支(天地会珠海分舵注:不同版本的安卓系统会有对应版本的CTS和CDD与其对应)。上面描述的CDD,CTS和源码,再加上你作为手机生产商提供的自身的硬件和软件定制,这就是你创造一个兼容性设备所需要的所有东西了。
For each release of the Android platform, a detailed CDD will be provided. The CDD represents the "policy" aspect of Android compatibility.
每当一个安卓操作系统平台发布的时候都会提供一个详尽的CDD文档,该文档代表了安卓兼容性的“策略”定义。
No test suite, including CTS, can truly be comprehensive. For instance, the CTS includes a test that checks for the presence and correct behavior of OpenGL graphics APIs, but no software test can verify that the graphics actually appear correctly on the screen. More generally, it's impossible to test the presence of hardware features such as keyboards, display density, Wi-Fi, and Bluetooth.
有些情况下,包括CTS在内,是没有任何测试套件是可以全能的对所有兼容性方面都做到详尽的自动测试的。比如,在CTS中有一个测试时用来检查OpenGL图形库APIs在屏幕上的正确呈现和正确行为的,但是没有任何软件测试可以验证对应的图形是真的呈现在屏幕上的(天地会珠海分舵注:包括该CTS的测试用例也只是调用OpenGL的API而已,而该测试是不能检测到屏幕是否有显示对应图形,只能靠肉眼去观测。这个也就是在软件测试行业所共知的不是所有功能都是可以实现测试自动化的)。更通俗的来说,(用测试工具)去测试硬件呈现方面的功能是不可能的,比如去测试按键物理键盘(是否可用),屏幕密度,Wi-Fi硬件功能,蓝牙硬件功能。
The CDD's role is to codify and clarify specific requirements, and eliminate ambiguity. The CDD does not attempt to be comprehensive. Since Android is a single corpus of open-source code, the code itself is the comprehensive "specification" of the platform and its APIs. The CDD acts as a "hub" referencing other content (such as SDK API documentation) that provides a framework in which the Android source code may be used so that the end result is a compatible system.
CDD所处的角色就是去定义和澄清具体的需求,并且消除模棱两可的有歧义的情况。CDD不会去尝试做到无所不包含,因为安卓自身就是一个开源的代码集合,代码自身就是对安卓平台和它提供的APIs的一个全方位的”说明文档“(天地会珠海分舵注:了解过敏捷开发和重构等相关知识的应该都清楚一个说法--去文档化,优秀代码就是最好的文档)。CDD扮演的就是一个”集线器“角色,(把进来的对兼容性的需求)重新分发引用到其他对应的内容(比如SDK API 文档),该内容提供了一个安卓源码会用到的框架,这样整个系统就自然会成为一个兼容的系统了。(天地会珠海分舵注:这一段应该有更好的翻译方式,如果看官有的请提供出来,本人会选择性采纳)
If you want to build a device compatible with a given Android version, start by checking out the source code for that version, and then read the corresponding CDD and stay within its guidelines. For additional details, simply examine the latest CDD.
如果你想在一个已定的安卓版本中创建一个兼容性设备,请从把该版本的安卓系统×××下来开始,然后仔细的阅读该版本源码对应的CDD文档并遵循它的指引。更多额外的相关内容,请查看最近的CDD文档。
The CTS is a free, commercial-grade test suite, available for download. The CTS represents the "mechanism" of compatibility.
CTS是一个免费的,商业级别的测试套件,且可供下载。CTS代表了安卓兼容性的”机制“。
The CTS runs on a desktop machine and executes test cases directly on attached devices or an emulator. The CTS is a set of unit tests designed to be integrated into the daily workflow (such as via a continuous build system) of the engineers building a device. Its intent is to reveal incompatibilities early on, and ensure that the software remains compatible throughout the development process.
CTS是跑在你的桌面系统上面来驱动连接上桌面系统主机的设备或者模拟器去运行相应的测试用例(脚本)的。CTS是一套单元测试的集合,是设计来让我们来集成到我们的日常工作流程(比如通过集成到我们的持续集成系统构建系统)来帮助工程师构建一个安卓设备系统的。它的本意就是去在早期把不兼容的地方给暴露出来,去保证在整个安卓设备系统开发的流程中该设备是一直保持兼容的。
The Compatibility Test Suite Verifier (CTS Verifier) is a supplement to the CTS available for download. CTS Verifier provides tests for APIs and functions that cannot be tested on a stationary device without manual input (e.g. audio quality, accelerometer, etc).
兼容性测试套件验证器(CTS 验证器)是CTS的一个附件功能(天地会珠海分舵:其实就是一个APK),可以在这里进行下载。CTS验证器提供了针对一些在没有户输入等交互动作就完成不了的APIs和功能测试(比如:音频质量,加速计,等等)
For details on the CTS, consult the CTS introduction.
关于CTS的详细信息,请查询”CTS简介“。
另外有需要云服务器可以了解下创新互联scvps.cn,海内外云服务器15元起步,三天无理由+7*72小时售后在线,公司持有idc许可证,提供“云服务器、裸金属服务器、高防服务器、香港服务器、美国服务器、虚拟主机、免备案服务器”等云主机租用服务以及企业上云的综合解决方案,具有“安全稳定、简单易用、服务可用性高、性价比高”等特点与优势,专为企业上云打造定制,能够满足用户丰富、多元化的应用场景需求。