官方英文文檔鏈接: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.
安卓的兼容性方案讓安卓手機(jī)生產(chǎn)商能夠很容易就開發(fā)中可兼容的安卓設(shè)備(天地會(huì)珠海分舵注:可兼容什么呢?就是可以兼容標(biāo)準(zhǔn)google提供的安卓系統(tǒng)可以支持的功能,以防手機(jī)生產(chǎn)商把開源的安卓系統(tǒng)修改得面目全非后,開發(fā)者開發(fā)的應(yīng)用都安裝不上了,所以才有了CTS來(lái)要求手機(jī)開發(fā)上必須測(cè)試通過(guò)才能上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.
安卓的兼容性方案兼顧了整個(gè)安卓社區(qū)各個(gè)團(tuán)體的利益,包括用戶,開發(fā)人員和手機(jī)生產(chǎn)商。其中這些團(tuán)體之間互相依賴,用戶希望在廣大范圍內(nèi)對(duì)手機(jī)類型和優(yōu)秀應(yīng)用進(jìn)行選擇;而優(yōu)秀的應(yīng)用的開發(fā)者又會(huì)受到一個(gè)廣大的市場(chǎng)所激勵(lì)而去開發(fā)出更多優(yōu)秀的應(yīng)用,因?yàn)樗麄兊膽?yīng)用可以通過(guò)這個(gè)廣大的市場(chǎng)到達(dá)使用不同類型手機(jī)的用戶手上;而設(shè)備生產(chǎn)商又依賴這些廣泛的優(yōu)秀的應(yīng)用來(lái)提升它們的產(chǎn)品對(duì)用戶的價(jià)值。(天地會(huì)珠海分舵注:其實(shí)整一段話google的意義就是想表達(dá)我的google play是一個(gè)多么強(qiáng)大的應(yīng)用市場(chǎng)。你安卓設(shè)備生產(chǎn)商設(shè)備想賺錢,想更多的開發(fā)者可以開發(fā)適合你的機(jī)型的應(yīng)用,想更多的用戶使用你的手機(jī),那么你就要用我的google play,而你要用我的google play,那么你閹割修改后的安卓操作系統(tǒng)就必須滿足一定的規(guī)則,不然用戶在我的google play下載了個(gè)應(yīng)用到你手上竟然用不了就對(duì)大家都沒有好處了)
Our goals were designed to benefit each of these groups:
我們的目的是為了讓以下這部分人受惠而設(shè)計(jì)的:
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.
為應(yīng)用開發(fā)人員提供一個(gè)一致的應(yīng)用開發(fā)環(huán)境和硬件環(huán)境:如果沒有一個(gè)兼容性標(biāo)準(zhǔn)的話,各種設(shè)備將會(huì)五花八門,而開發(fā)人員就必須為每個(gè)不同的設(shè)備開發(fā)不同版本的應(yīng)用。兼容性方案以一套預(yù)先規(guī)定好的APIs和capabilities(天地會(huì)珠海分舵注:capabilities可以理解成手機(jī)的一些特性)的形式為開發(fā)人員預(yù)期能從一個(gè)兼容性設(shè)備可以獲得的功能提供了一個(gè)精準(zhǔn)的定義。這樣開發(fā)人員就可以利用這些信息來(lái)很好的對(duì)如何設(shè)計(jì)他們的應(yīng)用做一個(gè)決定,且這樣他們就非常有信心他們開發(fā)的應(yīng)用可以在任何兼容的設(shè)備上良好的運(yùn)行。
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.
為消費(fèi)者提供一個(gè)一致的應(yīng)用體驗(yàn):如果一個(gè)應(yīng)用在一個(gè)兼容性設(shè)備上可以很好的運(yùn)行,那么它就應(yīng)該可以在所有同安卓版本的兼容性設(shè)備上很好的運(yùn)行。各種安卓設(shè)備無(wú)論在硬件和軟件特性上都會(huì)有所不同,所以這個(gè)兼容方案會(huì)為如Google Player等的各種應(yīng)用分發(fā)平臺(tái)提供相應(yīng)的工具來(lái)開發(fā)對(duì)應(yīng)的過(guò)濾功能,什么意思呢?意思就是用戶在該分發(fā)平臺(tái)上只會(huì)看到他們的手機(jī)可以運(yùn)行的應(yīng)用。
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.
讓設(shè)備生產(chǎn)商可以在可兼容的同時(shí)又可獨(dú)樹一幟:安卓的兼容性方案關(guān)注的方面是安裝在設(shè)備上的安卓系統(tǒng)是否可以很好的運(yùn)行第三方應(yīng)用(天地會(huì)珠海分舵注:除生產(chǎn)商自己提供的應(yīng)用外的第三方應(yīng)用),這就允許設(shè)備生產(chǎn)商在考慮到兼容性的同時(shí)怎么創(chuàng)建一個(gè)獨(dú)特的別具一格的的設(shè)備提供了很大的彈性空間(天地會(huì)珠海分舵注:因?yàn)槭謾C(jī)生產(chǎn)商只需要保證能滿足安卓的兼容性方案,那么就可以對(duì)設(shè)備做任何其他的事情了)
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.
最小化兼容性所帶來(lái)的附加成本:保證設(shè)備的兼容性對(duì)設(shè)備生產(chǎn)商來(lái)說(shuō)應(yīng)該是很容易且不昂貴的事情。安卓兼容性方案提供的工具是免費(fèi)的,開源的,可下載的。它設(shè)計(jì)出來(lái)本身就是為了讓設(shè)備生產(chǎn)商在在設(shè)備開發(fā)過(guò)程中進(jìn)行持續(xù)的自測(cè),這樣設(shè)備生產(chǎn)商就可以消除開發(fā)流程變化或者把設(shè)備送到第三方機(jī)構(gòu)進(jìn)行兼容性檢測(cè)所帶來(lái)的附加成本。同時(shí),安卓兼容性方案不需要任何的認(rèn)證,所以不會(huì)產(chǎn)生相應(yīng)的費(fèi)用和賬單。
The Android compatibility program consists of three key components:
安卓兼容性方案由以下3個(gè)關(guān)鍵部分組成:
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.
正如不同版本的安卓平臺(tái)的源碼會(huì)從源碼樹中分出不同的對(duì)應(yīng)的分支一樣,不同版本的CTS和CDD也會(huì)有不同的分支(天地會(huì)珠海分舵注:不同版本的安卓系統(tǒng)會(huì)有對(duì)應(yīng)版本的CTS和CDD與其對(duì)應(yīng))。上面描述的CDD,CTS和源碼,再加上你作為手機(jī)生產(chǎn)商提供的自身的硬件和軟件定制,這就是你創(chuàng)造一個(gè)兼容性設(shè)備所需要的所有東西了。
For each release of the Android platform, a detailed CDD will be provided. The CDD represents the "policy" aspect of Android compatibility.
每當(dāng)一個(gè)安卓操作系統(tǒng)平臺(tái)發(fā)布的時(shí)候都會(huì)提供一個(gè)詳盡的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在內(nèi),是沒有任何測(cè)試套件是可以全能的對(duì)所有兼容性方面都做到詳盡的自動(dòng)測(cè)試的。比如,在CTS中有一個(gè)測(cè)試時(shí)用來(lái)檢查OpenGL圖形庫(kù)APIs在屏幕上的正確呈現(xiàn)和正確行為的,但是沒有任何軟件測(cè)試可以驗(yàn)證對(duì)應(yīng)的圖形是真的呈現(xiàn)在屏幕上的(天地會(huì)珠海分舵注:包括該CTS的測(cè)試用例也只是調(diào)用OpenGL的API而已,而該測(cè)試是不能檢測(cè)到屏幕是否有顯示對(duì)應(yīng)圖形,只能靠肉眼去觀測(cè)。這個(gè)也就是在軟件測(cè)試行業(yè)所共知的不是所有功能都是可以實(shí)現(xiàn)測(cè)試自動(dòng)化的)。更通俗的來(lái)說(shuō),(用測(cè)試工具)去測(cè)試硬件呈現(xiàn)方面的功能是不可能的,比如去測(cè)試按鍵物理鍵盤(是否可用),屏幕密度,Wi-Fi硬件功能,藍(lán)牙硬件功能。
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不會(huì)去嘗試做到無(wú)所不包含,因?yàn)榘沧孔陨砭褪且粋€(gè)開源的代碼集合,代碼自身就是對(duì)安卓平臺(tái)和它提供的APIs的一個(gè)全方位的”說(shuō)明文檔“(天地會(huì)珠海分舵注:了解過(guò)敏捷開發(fā)和重構(gòu)等相關(guān)知識(shí)的應(yīng)該都清楚一個(gè)說(shuō)法--去文檔化,優(yōu)秀代碼就是最好的文檔)。CDD扮演的就是一個(gè)”集線器“角色,(把進(jìn)來(lái)的對(duì)兼容性的需求)重新分發(fā)引用到其他對(duì)應(yīng)的內(nèi)容(比如SDK API 文檔),該內(nèi)容提供了一個(gè)安卓源碼會(huì)用到的框架,這樣整個(gè)系統(tǒng)就自然會(huì)成為一個(gè)兼容的系統(tǒng)了。(天地會(huì)珠海分舵注:這一段應(yīng)該有更好的翻譯方式,如果看官有的請(qǐng)?zhí)峁┏鰜?lái),本人會(huì)選擇性采納)
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.
如果你想在一個(gè)已定的安卓版本中創(chuàng)建一個(gè)兼容性設(shè)備,請(qǐng)從把該版本的安卓系統(tǒng)×××下來(lái)開始,然后仔細(xì)的閱讀該版本源碼對(duì)應(yīng)的CDD文檔并遵循它的指引。更多額外的相關(guān)內(nèi)容,請(qǐng)查看最近的CDD文檔。
The CTS is a free, commercial-grade test suite, available for download. The CTS represents the "mechanism" of compatibility.
CTS是一個(gè)免費(fèi)的,商業(yè)級(jí)別的測(cè)試套件,且可供下載。CTS代表了安卓兼容性的”機(jī)制“。
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是跑在你的桌面系統(tǒng)上面來(lái)驅(qū)動(dòng)連接上桌面系統(tǒng)主機(jī)的設(shè)備或者模擬器去運(yùn)行相應(yīng)的測(cè)試用例(腳本)的。CTS是一套單元測(cè)試的集合,是設(shè)計(jì)來(lái)讓我們來(lái)集成到我們的日常工作流程(比如通過(guò)集成到我們的持續(xù)集成系統(tǒng)構(gòu)建系統(tǒng))來(lái)幫助工程師構(gòu)建一個(gè)安卓設(shè)備系統(tǒng)的。它的本意就是去在早期把不兼容的地方給暴露出來(lái),去保證在整個(gè)安卓設(shè)備系統(tǒng)開發(fā)的流程中該設(shè)備是一直保持兼容的。
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).
兼容性測(cè)試套件驗(yàn)證器(CTS 驗(yàn)證器)是CTS的一個(gè)附件功能(天地會(huì)珠海分舵:其實(shí)就是一個(gè)APK),可以在這里進(jìn)行下載。CTS驗(yàn)證器提供了針對(duì)一些在沒有戶輸入等交互動(dòng)作就完成不了的APIs和功能測(cè)試(比如:音頻質(zhì)量,加速計(jì),等等)
For details on the CTS, consult the CTS introduction.
關(guān)于CTS的詳細(xì)信息,請(qǐng)查詢”CTS簡(jiǎn)介“。
另外有需要云服務(wù)器可以了解下創(chuàng)新互聯(lián)scvps.cn,海內(nèi)外云服務(wù)器15元起步,三天無(wú)理由+7*72小時(shí)售后在線,公司持有idc許可證,提供“云服務(wù)器、裸金屬服務(wù)器、高防服務(wù)器、香港服務(wù)器、美國(guó)服務(wù)器、虛擬主機(jī)、免備案服務(wù)器”等云主機(jī)租用服務(wù)以及企業(yè)上云的綜合解決方案,具有“安全穩(wěn)定、簡(jiǎn)單易用、服務(wù)可用性高、性價(jià)比高”等特點(diǎn)與優(yōu)勢(shì),專為企業(yè)上云打造定制,能夠滿足用戶豐富、多元化的應(yīng)用場(chǎng)景需求。