android-2.3-cdd

合集下载

Broidmobi CTS 测试全解

Broidmobi CTS 测试全解

Broadmobi CTS 测试全解目录Android 软件兼容性测试简介 (1)CTS简介 (1)CTS在android软件兼容性测试的意义 (2)CTS在终端上的测试详解 (2)CTS 终端需求 (2)CTS组成 (2)摩尔实验室开展Android CTS认证测试服务 (3)1. 终端下载版本以及准备 (4)2. 编译 (6)源码编译 (6)SDK编译 (8)CTS编译 (8)3. USB连接 (9)4. 准备测试 (10)5. 开始测试 (12)6. 调试 (14)7. 测试结果 (15)Android 软件兼容性测试简介Android兼容性测试(CTS)和连带的兼容性定义文档(CDD),是一个确保终端设备与特定版本Android(比如Android2.2,2.3,3.0)兼容的自管理程序。

CTS测试集包含大约24,000个在Android设备上运行的测试用例,这些用例分别针对电话、图形、相机、GPS、触摸屏、无线网等功能。

Google针对每个主要Android版本公布了CDD文档,其中指出了对CTS中每类测试的具体要求。

CTS简介CTS拥有兼容性测试包。

CTS是一个自动化的测试工具,其中包括两个主要的软件组件:CTS测试工具可以运行在您的台式机和管理测试执行。

连接的移动设备或模拟器上执行个别测试案例。

作为JUnit测试,并打包为Android是用Java编写测试用例。

apk文件运行在实际设备上的目标。

手机设备需要通过Android的兼容性测试(CTS),以确保在android上开发的程序在手机设备上都能运行。

你的设备只有满足CDD的规定并且通过CTS,才有可能获得Android的商标和享受Android Market的权限。

这里有可能指的是需要你自己去向google申请的。

CTS在android软件兼容性测试的意义通过CTS测试之后便允许在设备上使用Android商标,它标志着该设备能够良好兼容软件市场中的数十万应用程序。

android兼容性测试CTS测试过程(实践测试验证通过)

android兼容性测试CTS测试过程(实践测试验证通过)

android兼容性测试CTS测试过程(实践测试验证通过)写这个博客的时候是为了记忆,建议⼤家还是看官⽅的说明,官⽅说的很清楚,不想把官⽅⼤段⼤段的拷贝到这⾥,官⽅的的确说的很清楚:⼀、Android的CTS测试,英⽂为Compatibility Test Suite,意为兼容性测试。

只有通过CTS测试的设备才有可能获得Android的商标和享受Android Market的权限;Android的CTS⽬的与意义:⽤户在android系统中有更好的⽤户体验,并且展⽰android应⽤的优越性,使得android开发者更容易编写⾼质量的andorid程序。

⼆、CTS是兼容性测试,Google为了防⽌⼚商对Android的改动影响其SDKAPI的兼容性,即第三⽅应⽤程序安装到该⼚商的机器上都能正常运⾏;这个差不多是⾃动跑的,会测试硬件(⽐如GPS,WIFI),还有其他⼀系列的东西,跑完之后会出⼀份详细的报告,告诉你哪些地⽅没通过。

三、我们实际使⽤CTS的过程中,很可能需要根据特定的要求,来定制⾃⼰的TestPlan。

这时就需要⾃⼰编译CTS官⽅说明Compatibility Test SuiteWhat is the purpose of the CTS?The Compatibility Test Suite is a tool used by device manufacturers to help ensure their devices are compatible, and to report test results for validations. The CTS is intended to be run frequently by OEMs throughout the engineering process to catch compatibility issues early. What kinds of things does the CTS test?The CTS currently tests that all of the supported Android strong-typed APIs are present and behave correctly. It also tests other non-API system behaviors such as application lifecycle and performance. We plan to add support in future CTS versions to test "soft" APIs such as Intents as well.CTS是⼀个免费的,商⽤级的测试套件,可供下载,CTS运⾏于台式机的直接连接的设备或仿真器,并执⾏测试⽤例。

Android2.3SD卡挂载流程浅析(三)

Android2.3SD卡挂载流程浅析(三)

Android2.3SD卡挂载流程浅析(三)这里只是简要的分析SD卡挂载过程中重要的代码调用,并没有深入分析代码,因为这一部分网上已有牛人比较详尽的分析了,后面我会贴出这些参考文章。

整个过程从Kernel检测到SD卡插入事件开始,之前的一些硬件中断的触发以及driver的加载这里并不叙述,一直到SD卡挂载消息更新到“Android——系统设置——存储”一项中。

1. Kernel发出SD卡插入uevent。

2. NetlinkHandler::onEvent()接收内核发出的uevent并进行解析。

3. VolumeManager::handlBlockEvent()处理经过第二步处理后的事件。

4. 接下来调用DirectVolume:: handleBlockEvent()。

在该方法中主要有两点需要注意:第一,程序首先会遍历mPath容器,寻找与event对应的sysfs_path是否存在与mPath容器中。

第二,针对event中的action有4种处理方式:Add,Removed,Change,Noaction 。

例如:在Add action中会有如下操作(因为我们这里所讲的是SD 卡的挂载流程,因此以Add来说明),首先创建设备节点,其次对disk 和partition两种格式的设备分别进行处理。

SD卡属于disk类型。

5. 经过上一步之后会调用DirectVolume::handleDiskAdded()方法,在该方法中会广播disk insert消息。

6. SocketListener::runListener会接收DirectVolume::handleDiskAdded()广播的消息。

该方法主要完成对event中数据的获取,通过Socket。

(PS:这里的SocketListener.cpp 位于Android源码/system/core/libsysutils/src/中,后文的FramworkListener.cpp也是,之前自己找了很久 T_T)7. 调用FrameworkListener::onDataAvailable()方法处理接收到的消息内容。

Android常用adb命令总结

Android常用adb命令总结

Android常⽤adb命令总结针对移动端 Android 的测试, adb 命令是很重要的⼀个点,必须将常⽤的 adb 命令熟记于⼼,将会为 Android 测试带来很⼤的⽅便,其中很多命令将会⽤于⾃动化测试的脚本当中。

Android Debug Bridgeadb 其实就是Android Debug Bridge, Android 调试桥的缩写,adb 是⼀个C/S架构的命令⾏⼯具,主要由 3 部分组成:运⾏在 PC 端的 Client : 可以通过它对 Android 应⽤进⾏安装、卸载及调试Eclipse 中的 ADT、SDK Tools ⽬录下的 DDMS、Monitor 等⼯具,都是同样地⽤到了 adb 的功能来与 Android 设备进⾏交互。

PC 端的⼿机助⼿,诸如 360 ⼿机助⼿、豌⾖荚、应⽤宝等,其除了安装第三⽅应⽤⽅便,其他的功能,基本上都可以通过 adb 命令去完成,这⾥建议测试⼈员尽量不要在电脑上安装这类⼿机助⼿,因为其⾃带的 adb 程序可能会与 Android SDK下的 adb 程序产⽣冲突,5037端⼝被占⽤,导致使⽤ adb 命令时⽆法连接到设备运⾏在 PC 端的 Service : 其管理客户端到 Android 设备上 adb 后台进程的连接adb 服务启动后,Windows 可以在任务管理器中找到 adb.exe 这个进程运⾏在 Android 设备上的 adb 后台进程执⾏adb shell ps | grep adbd,可以找到该后台进程,windows 请使⽤findstr替代 grep[xuxu:~]$ adb shell ps | grep adbdroot 23227 1 6672 832 ffffffff 00019bb4 S /sbin/adbd这⾥注意⼀个地⽅,就是 adb 使⽤的端⼝号,5037,有必要记⼀下接下来我将 adb 命令分为三部分进⾏介绍,adb 命令、adb shell 命令、linux 命令adb 命令在开发或者测试的过程中,我们可以通过 adb 来管理多台设备,其⼀般的格式为:adb [-e | -d | -s <设备序列号>] <⼦命令>在配好环境变量的前提下,在命令窗⼝当中输⼊ adb help 或者直接输⼊ adb ,将会列出所有的选项说明及⼦命令。

安卓2.3系统官方自带的程序列表

安卓2.3系统官方自带的程序列表

在此我只列出安卓2.3系统官方自带的程序列表,至于其余剩下的第三方如电信和华为绑定的程序就不列出来了.还是先免责声明下:此列表所给的建议纯粹只是以追求过度的纯净核心为目的而列出的建议,并不一定能保证稳定,想要纯净加稳定的话就把以下列表之外的程序全删了就好(包括data 和cust下的).而以下的建议我都是亲测过的,不信的可看这帖,但是如果有按我的建议造成不稳定现象及需要刷机的话,本人一概不负责.说明:/前面是软件名称,/后面是建议,要删的话要连同同名的odex文件一并删除,删前最好备份下,以备恢复.AccountAndSyncSettings.apk 【同步功能/不用可删】删除后点击设置中-帐户同步会出错ApplicationsProvider.apk【应用程序储存/保留】Bluetooth.apk【蓝牙/不用可删,换第三方可删】Browser.apk【谷歌浏览器/换第三方可删】Calculator.apk【计算器/可删】Calendar.apk【日历/换第三方可删】CalendarProvider.apk【日历储存/可删】Camera.apk【照相机/换第三方可删】CertInstaller.apk【证书安装/貌似没用选删】Contacts.apk【联系人/换第三方可删】ContactsProvider.apk【联系人服务/保留】cpwservice.apk【cdma+wlan网的服务/不建议删】DefaultContainerService.apk【默认通讯录服务/楼主惨剧证明必须保留不然无法安装apk包!/】DeskClock.apk【闹钟/不用可删】DownloadProviderUi.apk【啥玩意下载服务Ui/最好不删除】DownloadProvider.apk【啥玩意下载服务/最好不删除】Email.apk【电子邮件/可删】FileManager.apk【文件管理器可删/系统内还有RE呢】FMRadio.apk【收音机可删】Gallery3D.apk 【3d图库/卡得一B删除!!!】HTMLViewer.apk【HTML查看器/没用可删】HuaweiDRMService.apk【华为的受保护数据存储服务/保留】HWDrmApp.apk【华为的受保护数据存储程序/保留】HwWallpaperChooser.apk【华为壁纸选择器/选删】InConfig.apk【IN附加设置/最好不删除】LatinIME.apk【安卓键盘输入法/无中文删之】Launcher2.apk【启动器原生桌面/桌面类软件至少要保留一款,选删】LiveWallpapersPicker.apk【动态壁纸/最好不删除】LiveWallpapers.apk【动态壁纸/同删】MagicSmokeWallpapers.apk【魔幻烟雾壁纸/不用这个的可删之】MediaProvider.apk【媒体储存/这个是不可以删除的如果你删除了你的3D图库不能加载你卡上的图片音乐播放器不能加载卡上的音乐文件】MMITest_II.apk【工程模式中的测试软件/测手机用的,不想测的可删】Mms.apk【原装短信mms/删了会收不到短信。

安卓系统简介

安卓系统简介

年后,他们盖起了房子,有了各自的家庭、子女,有了自己建造的渔船,
过上了幸福安康的生活
启示:一个人只顾眼前的利益,得到的终将是短暂的欢 愉;一个人目标高远,但也要面对现实的生活。只有把 理想和现实有机结合起来,才有可能成为一个成功之人。 有时候,一个简单的道理,却足以给人意味深长的生命 启示。
Android是基于Linux内核的操作系统,是Google公司在2007年11月5日 公布的手机操作系统,早期由Google开发,后由开放手持设备联盟 (Open Handset Alliance)开发。它采用了软件堆层(software stack, 又名以软件叠层)的架构,主要分为三部分。底层Linux内核只提供基 本功能;其他的应用软件则由各公司自行开发,部分程序以Java编写。 2011年初数据显示,仅正式推出三年的操作系统Android已经超越称霸 十年的塞班系统,采用Android系统主要厂商包括美国摩托罗拉 (MOTOROLA)、英国索尼爱立信(Sony Ericsson)另外还有中国 厂商如:HTC、联想、华为等,使之跃居全球最受欢迎的智能手机平台, Android系统不但应用于智能手机,也在平板电脑市场急速扩张。
通讯方式:支持前置摄像头、SIP/VOIP和NFC(近场通讯)
简化界面、速度提升:
更快更直观的文字输入:
一键文字选择和复制/粘帖:
改进的电源管理系统:
原生支持前置前置摄像头、互联网通话和NFC(近场通讯):
增加下载管理器:
手机网络下载速度
上行速率一般是指从你的电脑上传的速度,也 就说别人从你的电脑进行通讯的速率!
下行速率一般是你从网络上的主机下载速度!
一般ADSL上网方式上行与下行速率是不对称的,一 般下行速率比较高!上行比较低!现在1M普通是上行: 386Kb,下行:1024Kb! 2M上行:386Kb,下 行:2048Kb

标准Action

标准Action

Android2.3发布,新特性一览Posted on 2010/12/07 by 繁星Android的新版本在经历了版本号变更(从3.0到2.3),新特性猜测,发布时间延期(从11.11到12.6)之后,终于真的来到了我们这些开发者面前了。

让我们迫不及待的看看Android2.3有哪些新特性吧。

首先,为游戏开发的增强:∙新的并发垃圾回收机制∙更多的读取系统信息的原生接口∙原生接口可以获取输入和访问传感器了∙EGL/OpenGL ES、OpenSL ES∙新的管理窗口和生命周期的框架。

其次,多媒体和更多的通讯方式:∙毫无疑问的支持了Google自家的VP8 and WebM∙支持AAC and AMR-wideband编码∙新的音频效果器,比如混响、均衡、虚拟耳机和低频提升∙支持前置摄像头(为视频电话准备的)∙SIP、VOIP支持(为Google voice准备的)∙NFC支持其他改进:∙优化用户界面:简化、提速(期待在真机上体验)∙输入界面改进:更快、更直观∙改进电源管理(需要跟进一步了解它是如何做的)∙新的应用管理方式∙新的下载管理器,似乎是个有趣的东西,号称会管理浏览器、email等所有应用中下载的文件。

截取自:Adroid2.3官方说明(/2010/12/android-23-platform-and-updated-sdk.html,需Fan墙)Posted in Uncategorized, 技术动态 | Tagged 技术动态 | Leave a comment Android 2.3在SDK和开发环境的改进Posted on 2010/12/07 by 繁星Android 2.3在SDKtools和开发环境的改进主要有:∙简化debug和build∙集成了ProGuard,以方便开发者保护自己的源代码∙改进了HierarchyViewer∙新的UI Builder的预览Android开发者们赶紧去体验吧。

Android SDK 2.3与Eclipse最新版开发环境搭建

Android SDK 2.3与Eclipse最新版开发环境搭建

no Pain no Gain no Gavin博客同步更新至:/deaboway /deaboway一、 背景和准备1. Android 简介 Android 是 Google 于 2007 年 11 月 5 日宣布的基于 Linux 平台的开源手机操 作系统的名称,该平台由操作系统、中间件、用户界面和应用软件组成,号称是 首个为移动终端打造的真正开放和完整的移动软件。

可以把它简单理解成 Linux 上套了一个 JAVA 的壳。

Android 的平台基本上是免费的,虽然有部份原生链接库会要求费用,但大 部份是免权利金。

Android 的程序可以采用 JAVA 开发, 因为它的虚拟机(Virtual Machine) Dalvik,只是它将 JAVA 的 bytecode 转成自己的格式,回避掉需要付 给 SUN 有关 JAVA 的授权费用。

因此,Android 开发环境是需要 JDK 的。

2. Android 网络资源 Android的网站是:/,目前还可以登陆,比较悲剧 的是:其Partners部分:/和Developers部分: /,大陆地区已经无法访问。

Android的系统要求请参考: /sdk/requirements.html 当前最新版本的Android SDK下载器(真正的SDK还是需要另外下载的),小 于是 生是无法直接到官网/sdk/index.html 下载的, 下载 另外找了一个地址/sdk/index.html, 链接和说明如下: Android SDK for Windows android-sdk_r08-windows.zip /android/android-sdk_r08-windows.zip installer_r08-windows.exe (Recommended) /android/installer_r08-windows.exe Android SDK for Mac OS X (intel) android-sdk_r08-mac_86.zip /android/android-sdk_r08-mac_86.zip Android SDK for Linux (i386) android-sdk_r08-linux_86.tgz /android/android-sdk_r08-linux_86.tgz Here's an overview of the steps you must follow to set up the Android SDK: 1. Prepare your development computer and ensure it meets the system requirements. 2. Install the SDK starter package from the table above. (If you're on Windows, download the installer for help with the initial setup.) 3. Install the ADT Plugin for Eclipse (if you'll be developing in Eclipse). 4. Add Android platforms and other components to your SDK. 5. Explore the contents of the Android SDK (optional).1no Pain no Gain no Gavin博客同步更新至:/deaboway /deaboway3. 软件包下载 a. JDK 1.6 下载网址: /technetwork/java/javase/downloads/index.html 当前最新版本为 Java SE 6 Update 23 小生机器上安装的是:jdk1.6.0_21,也一样用,其实只要你是 JDK1.5 以上 就可以了。

  1. 1、下载文档前请自行甄别文档内容的完整性,平台不提供额外的编辑、内容补充、找答案等附加服务。
  2. 2、"仅部分预览"的文档,不可在线预览部分如存在完整性等问题,可反馈申请退款(可完整预览的文档不适用该条件!)。
  3. 3、如文档侵犯您的权益,请联系客服反馈,我们会尽快为您处理(人工客服工作时间:9:00-18:30)。

Android 2.3 Compatibility DefinitionCopyright © 2010, Google Inc. All rights reserved.compatibility@Table of Contents1. Introduction2. Resources3. Software3.1. Managed API Compatibility3.2. Soft API Compatibility3.2.1. Permissions3.2.2. Build Parameters3.2.3. Intent Compatibility3.2.3.1. Core Application Intents3.2.3.2. Intent Overrides3.2.3.3. Intent Namespaces3.2.3.4. Broadcast Intents3.3. Native API Compatibility3.4. Web Compatibility3.4.1. WebView Compatibility3.4.2. Browser Compatibility3.5. API Behavioral Compatibility3.6. API Namespaces3.7. Virtual Machine Compatibility3.8. User Interface Compatibility3.8.1. Widgets3.8.2. Notifications3.8.3. Search3.8.4. Toasts3.8.5. Live Wallpapers4. Application Packaging Compatibility5. Multimedia Compatibility5.1. Media Codecs5.1.1. Media Decoders5.1.2. Media Encoders5.2. Audio Recording5.3. Audio Latency6. Developer Tool Compatibility7. Hardware Compatibility7.1. Display and Graphics7.1.1. Screen Configurations7.1.2. Display Metrics7.1.3. Declared Screen Support7.1.4. Screen Orientation7.1.5. 3D Graphics Accleration7.2. Input Devices7.2.1. Keyboard7.2.2. Non-touch Navigation7.2.3. Navigation keys7.2.4. Touchscreen input7.3. Sensors7.3.1. Accelerometer7.3.2. Magnetometer7.3.3. GPS7.3.4. Gyroscope7.3.5. Barometer7.3.6. Thermometer7.3.7. Photometer7.3.8. Proximity Sensor7.4. Data Connectivity7.4.1. Telephony7.4.2. IEEE 802.11 (WiFi)7.4.3. Bluetooth7.4.4. Near-Field Communications7.4.5. Minimum Network Capability7.5. Cameras7.5.1. Rear-Facing Camera7.5.2. Front-Facing Camera7.5.3. Camera API Behavior7.5.4. Camera Orientation7.6. Memory and Storage7.6.1. Minimum Memory and Storage7.6.2. Application Shared Storage7.7. USB8. Performance Compatibility9. Security Model Compatibility9.1. Permissions9.2. UID and Process Isolation9.3. Filesystem Permissions9.4. Alternate Execution Environments10. Software Compatibility Testing10.1. Compatibility Test Suite10.2. CTS Verifier10.3. Reference Applications11. Updatable Software12. Contact UsAppendix A - Bluetooth Test Procedure1. IntroductionThis document enumerates the requirements that must be met in order for mobile phones to be compatible with Android 2.3.The use of "must", "must not", "required", "shall", "shall not", "should", "should not", "recommended", "may" and "optional" is per the IETF standard defined in RFC2119 [Resources, 1].As used in this document, a "device implementer" or "implementer" is a person or organization developing a hardware/software solution running Android 2.3. A "device implementation" or "implementation" is the hardware/software solution so developed.To be considered compatible with Android 2.3, device implementations MUST meet the requirements presented in this Compatibility Definition, including any documents incorporated via reference.Where this definition or the software tests described in Section 10 is silent, ambiguous, or incomplete, it is the responsibility of the device implementer to ensure compatibility with existing implementations. For this reason, the Android Open Source Project [Resources, 3] is both the reference and preferred implementation of Android. Device implementers are strongly encouraged to base their implementations to the greatest extent possible on the "upstream" source code available from the Android Open Source Project. While some components can hypothetically be replaced with alternate implementations this practice is strongly discouraged, as passing the software tests will become substantially more difficult. It is the implementer's responsibility to ensure full behavioral compatibility with the standard Android implementation, including and beyond the Compatibility Test Suite. Finally, note that certain component substitutions and modifications are explicitly forbidden by this document.2. Resources1.IETF RFC2119 Requirement Levels: /rfc/rfc2119.txt2.Android Compatibility Program Overview: /compatibility/index.html3.Android Open Source Project: /4.API definitions and documentation: /reference/packages.html5.Android Permissions reference: /reference/android/Manifest.permission.html6.android.os.Build reference: /reference/android/os/Build.html7.Android 2.3 allowed version strings: /compatibility/2.3/versions.html8.android.webkit.WebView class: /reference/android/webkit/WebView.html9.HTML5: /specs/web-apps/current-work/multipage/10.HTML5 offline capabilities: /html5/spec/Overview.html#offline11.HTML5 video tag: /html5/spec/Overview.html#video12.HTML5/W3C geolocation API: /TR/geolocation-API/13.HTML5/W3C webdatabase API: /TR/webdatabase/14.HTML5/W3C IndexedDB API: /TR/IndexedDB/15.Dalvik Virtual Machine specification: available in the Android source code, at dalvik/docs16.AppWidgets: /guide/practices/ui_guidelines/widget_design.html17.Notifications: /guide/topics/ui/notifiers/notifications.html18.Application Resources: /android/reference/available-resources.html19.Status Bar icon style guide: /guide/practices/ui_guideline /icon_design.html#statusbarstructure20.Search Manager: /reference/android/app/SearchManager.html21.Toasts: /reference/android/widget/Toast.html22.Live Wallpapers: /resources/articles/live-wallpapers.html23.Reference tool documentation (for adb, aapt, ddms): /guide/developing/tools/index.html24.Android apk file description: /guide/topics/fundamentals.html25.Manifest files: /guide/topics/manifest/manifest-intro.html26.Monkey testing tool: /guide/developing/tools/monkey.html27.Android Hardware Features List: /reference/android/content/pm/PackageManager.html28.Supporting Multiple Screens: /guide/practices/screens_support.html29.android.util.DisplayMetrics: /reference/android/util/DisplayMetrics.html30.android.content.res.Configuration: /reference/android/content/res/Configuration.html31.Sensor coordinate space: /reference/android/hardware/SensorEvent.html32.Bluetooth API: /reference/android/bluetooth/package-summary.html33.Camera orientation API: /reference/android/hardware/Camera.html#setDisplayOrientation(int)34.android.hardware.Camera: /reference/android/hardware/Camera.html35.Android Security and Permissions reference: /guide/topics/security/security.html36.Apps for Android: /p/apps-for-androidMany of these resources are derived directly or indirectly from the Android 2.3 SDK, and will be functionally identical to the information in that SDK's documentation. In any cases where this Compatibility Definition or the Compatibility Test Suite disagrees with the SDK documentation, the SDK documentation is considered authoritative. Any technical details provided in the references included above are considered by inclusion to be part of this Compatibility Definition.3. SoftwareThe Android platform includes a set of managed APIs, a set of native APIs, and a body of so-called "soft" APIs such as the Intent system andweb-application APIs. This section details the hard and soft APIs that are integral to compatibility, as well as certain other relevant technical and user interface behaviors. Device implementations MUST comply with all the requirements in this section.3.1. Managed API CompatibilityThe managed (Dalvik-based) execution environment is the primary vehicle for Android applications. The Android application programming interface (API) is the set of Android platform interfaces exposed to applications running in the managed VM environment. Device implementations MUST provide complete implementations, including all documented behaviors, of any documented API exposed by the Android 2.3 SDK [Resources, 4].Device implementations MUST NOT omit any managed APIs, alter API interfaces or signatures, deviate from the documented behavior, or includeno-ops, except where specifically allowed by this Compatibility Definition.This Compatibility Definition permits some types of hardware for which Android includes APIs to be omitted by device implementations. In such cases, the APIs MUST still be present and behave in a reasonable way. See Section 7 for specific requirements for this scenario.3.2. Soft API CompatibilityIn addition to the managed APIs from Section 3.1, Android also includes a significant runtime-only "soft" API, in the form of such things such as Intents, permissions, and similar aspects of Android applications that cannot be enforced at application compile time. This section details the "soft" APIs and system behaviors required for compatibility with Android 2.3. Device implementations MUST meet all the requirements presented in this section.3.2.1. PermissionsDevice implementers MUST support and enforce all permission constants as documented by the Permission reference page [Resources, 5]. Note that Section 10 lists additional requirements related to the Android security model.3.2.2. Build ParametersThe Android APIs include a number of constants on the android.os.Build class [Resources, 6] that are intended to describe the current device. To provide consistent, meaningful values across device implementations, the table below includes additional restrictions on the formats of these values to which device implementations MUST conform.Parameter Commentsandroid.os.Build.VERSION.RELEASE The version of the currently-executing Android system, inhuman-readable format. This field MUST have one of the string values defined in [Resources, 7].android.os.Build.VERSION.SDK The version of the currently-executing Android system, in a format accessible to third-party application code. For Android 2.3, this field MUST have the integer value 9.android.os.Build.VERSION.INCREMENTAL A value chosen by the device implementer designating the specific build of the currently-executing Android system, in human-readable format. This value MUST NOT be re-used for different builds made available to end users. A typical use of this field is to indicate which build number or source-control change identifier was used to generate the build. There are no requirements on the specific format of this field, except that it MUST NOT be null or the empty string ("").android.os.Build.BOARD A value chosen by the device implementer identifying the specific internal hardware used by the device, in human-readable format. A possible use of this field is to indicate the specific revision of the board powering the device. The value of this field MUST be encodable as7-bit ASCII and match the regular expression"^[a-zA-Z0-9.,_-]+$".android.os.Build.BRAND A value chosen by the device implementer identifying the name of the company, organization, individual, etc. who produced the device, in human-readable format. A possible use of this field is to indicate the OEM and/or carrier who sold the device. The value of this field MUST be encodable as 7-bit ASCII and match the regular expression"^[a-zA-Z0-9.,_-]+$".android.os.Build.DEVICE A value chosen by the device implementer identifying the specific configuration or revision of the body (sometimes called "industrial design") of the device. The value of this field MUST be encodable as 7-bit ASCII and match the regular expression"^[a-zA-Z0-9.,_-]+$".android.os.Build.FINGERPRINT A string that uniquely identifies this build. It SHOULD be reasonably human-readable. It MUST follow this template:$(BRAND)/$(PRODUCT)/$(DEVICE)/$(BOARD):$(VERSION.RELEASE)/$(ID)/$(VERSION.INCREMENTAL):$(TYPE)/$(TAGS) For example:acme/mydevice/generic/generic:2.3/ERC77/3359:userdebug/test-keysThe fingerprint MUST NOT include whitespace characters. If other fields included in the template above have whitespace characters, they MUST be replaced in the build fingerprint with another character, such as the underscore ("_") character. The value of this field MUST be encodable as 7-bit ASCII.android.os.Build.HOST A string that uniquely identifies the host the build was built on, in human readable format. There are no requirements on the specific format of this field, except that it MUST NOT be null or the empty string ("").android.os.Build.ID An identifier chosen by the device implementer to refer to a specific release, in human readable format. This field can be the same as android.os.Build.VERSION.INCREMENTAL, but SHOULD be a value sufficiently meaningful for end users to distinguish between software builds. The value of this field MUST be encodable as 7-bit ASCII and match the regular expression "^[a-zA-Z0-9.,_-]+$".android.os.Build.MODEL A value chosen by the device implementer containing the name of the device as known to the end user. This SHOULD be the same name under which the device is marketed and sold to end users. There are no requirements on the specific format of this field, except that it MUST NOT be null or the empty string ("").android.os.Build.PRODUCT A value chosen by the device implementer containing the development name or code name of the device. MUST be human-readable, but is not necessarily intended for view by end users. The value of this field MUST be encodable as 7-bit ASCII and match the regular expression "^[a-zA-Z0-9.,_-]+$".android.os.Build.TAGS A comma-separated list of tags chosen by the device implementer that further distinguish the build. For example, "unsigned,debug". The value of this field MUST be encodable as 7-bit ASCII and match the regular expression "^[a-zA-Z0-9.,_-]+$".android.os.Build.TIME A value representing the timestamp of when the build occurred.android.os.Build.TYPE A value chosen by the device implementer specifying the runtime configuration of the build. This field SHOULD have one of the values corresponding to the three typical Android runtime configurations: "user", "userdebug", or "eng". The value of this field MUST be encodable as 7-bit ASCII and match the regular expression"^[a-zA-Z0-9.,_-]+$".ER A name or user ID of the user (or automated user) that generated the build. There are no requirements on the specific format of this field, except that it MUST NOT be null or the empty string ("").3.2.3. Intent CompatibilityAndroid uses Intents to achieve loosely-coupled integration between applications. This section describes requirements related to the Intent patterns that MUST be honored by device implementations. By "honored", it is meant that the device implementer MUST provide an Android Activity or Service that specifies a matching Intent filter and binds to and implements correct behavior for each specified Intent pattern.3.2.3.1. Core Application IntentsThe Android upstream project defines a number of core applications, such as a phone dialer, calendar, contacts book, music player, and so on. Device implementers MAY replace these applications with alternative versions.However, any such alternative versions MUST honor the same Intent patterns provided by the upstream project. For example, if a device contains an alternative music player, it must still honor the Intent pattern issued by third-party applications to pick a song.The following applications are considered core Android system applications:•Desk Clock•Browser•Calendar•Calculator•Contacts•Email•Gallery•GlobalSearch•Launcher•Music•SettingsThe core Android system applications include various Activity, or Service components that are considered "public". That is, the attribute"android:exported" may be absent, or may have the value "true".For every Activity or Service defined in one of the core Android system apps that is not marked as non-public via an android:exported attribute with the value "false", device implementations MUST include a compontent of the same type implementing the same Intent filter patterns as the core Android system app.In other words, a device implementation MAY replace core Android system apps; however, if it does, the device implementation MUST support all Intent patterns defined by each core Android system app being replaced.3.2.3.2. Intent OverridesAs Android is an extensible platform, device implementers MUST allow each Intent pattern referenced in Section 3.2.3.1 to be overridden by third-party applications. The upstream Android open source project allows this by default; device implementers MUST NOT attach special privileges to system applications' use of these Intent patterns, or prevent third-party applications from binding to and assuming control of these patterns. This prohibition specifically includes but is not limited to disabling the "Chooser" user interface which allows the user to select between multiple applications which all handle the same Intent pattern.3.2.3.3. Intent NamespacesDevice implementers MUST NOT include any Android component that honors any new Intent or Broadcast Intent patterns using an ACTION, CATEGORY, or other key string in the android.* namespace. Device implementers MUST NOT include any Android components that honor any new Intent or Broadcast Intent patterns using an ACTION, CATEGORY, or other key string in a package space belonging to another organization. Device implementers MUST NOT alter or extend any of the Intent patterns used by the core apps listed in Section 3.2.3.1.This prohibition is analogous to that specified for Java language classes in Section 3.6.3.2.3.4. Broadcast IntentsThird-party applications rely on the platform to broadcast certain Intents to notify them of changes in the hardware or software environment.Android-compatible devices MUST broadcast the public broadcast Intents in response to appropriate system events. Broadcast Intents are described in the SDK documentation.3.3. Native API CompatibilityManaged code running in Dalvik can call into native code provided in the application .apk file as an ELF .so file compiled for the appropriate device hardware architecture. As native code is highly dependent on the underlying processor technology, Android defines a number of Application Binary Interfaces (ABIs) in the Android NDK, in the file docs/CPU-ARCH-ABIS.txt. If a device implementation is compatible with one or more defined ABIs, it SHOULD implement compatibility with the Android NDK, as below.If a device implementation includes support for an Android ABI, it:•MUST include support for code running in the managed environment to call into native code, using the standard Java Native Interface (JNI) semantics.•MUST be source-compatible (i.e. header compatible) and binary-compatible (for the ABI) with each required library in the list below•MUST accurately report the native Application Binary Interface (ABI) supported by the device, via the android.os.Build.CPU_ABI API •MUST report only those ABIs documented in the latest version of the Android NDK, in the file docs/CPU-ARCH-ABIS.txt•SHOULD be built using the source code and header files available in the upstream Android open-source projectThe following native code APIs MUST be available to apps that include native code:•libc (C library)•libm (math library)•Minimal support for C++•JNI interface•liblog (Android logging)•libz (Zlib compression)•libdl (dynamic linker)•libGLESv1_CM.so (OpenGL ES 1.0)•libGLESv2.so (OpenGL ES 2.0)•libEGL.so (native OpenGL surface management)•libjnigraphics.so•libOpenSLES.so (Open Sound Library audio support)•libandroid.so (native Android activity support)•Support for OpenGL, as described belowNote that future releases of the Android NDK may introduce support for additional ABIs. If a device implementation is not compatible with an existing predefined ABI, it MUST NOT report support for any ABI at all.Native code compatibility is challenging. For this reason, it should be repeated that device implementers are VERY strongly encouraged to use the upstream implementations of the libraries listed above to help ensure compatibility.3.4. Web CompatibilityMany developers and applications rely on the behavior of the android.webkit.WebView class [Resources, 8] for their user interfaces, so the WebView implementation must be compatible across Android implementations. Similarly, a complete, modern web broswer is central to the Android user experience. Device implementations MUST include a version of android.webkit.WebView consistent with the upstream Android software, and MUST include a modern HTML5-capable browser, as described below.3.4.1. WebView CompatibilityThe Android Open Source implementation uses the WebKit rendering engine to implement the android.webkit.WebView. Because it is not feasible to develop a comprehensive test suite for a web rendering system, device implementers MUST use the specific upstream build of WebKit in the WebView implementation. Specifically:•Device implementations' android.webkit.WebView implementations MUST be based on the 533.1 WebKit build from the upstream Android Open Source tree for Android 2.3. This build includes a specific set of functionality and security fixes for the WebView. Device implementers MAY include customizations to the WebKit implementation; however, any such customizations MUST NOT alter the behavior of the WebView, including rendering behavior.The user agent string reported by the WebView MUST be in this format:Mozilla/5.0 (Linux; U; Android $(VERSION); $(LOCALE); $(MODEL) Build/$(BUILD)) AppleWebKit/533.1 (KHTML, like Gecko) Version/4.0 Mobile Safari/533.1•The value of the $(VERSION) string MUST be the same as the value for android.os.Build.VERSION.RELEASE•The value of the $(LOCALE) string SHOULD follow the ISO conventions for country code and language, and SHOULD refer to the current configured locale of the device•The value of the $(MODEL) string MUST be the same as the value for android.os.Build.MODEL•The value of the $(BUILD) string MUST be the same as the value for android.os.Build.IDThe WebView component SHOULD include support for as much of HTML5 [Resources, 9] as possible. Minimally, device implementations MUST support each of these APIs associated with HTML5 in the WebView:•application cache/offline operation [Resources, 10]•the <video> tag [Resources, 11]•geolocation [Resources, 12]Additionally, device implementations MUST support the HTML5/W3C webstorage API [Resources, 13], and SHOULD support the HTML5/W3C IndexedDB API [Resources, 14]. Note that as the web development standards bodies are transitioning to favor IndexedDB over webstorage, IndexedDB is expected to become a required component in a future version of Android.HTML5 APIs, like all JavaScript APIs, MUST be disabled by default in a WebView, unless the developer explicitly enables them via the usual Android APIs.3.4.2. Browser CompatibilityDevice implementations MUST include a standalone Browser application for general user web browsing. The standalone Browser MAY be based on a browser technology other than WebKit. However, even if an alternate Browser application is used, the android.webkit.WebView component provided to third-party applications MUST be based on WebKit, as described in Section 3.4.1.Implementations MAY ship a custom user agent string in the standalone Browser application.The standalone Browser application (whether based on the upstream WebKit Browser application or a third-party replacement) SHOULD include support for as much of HTML5 [Resources, 9] as possible. Minimally, device implementations MUST support each of these APIs associated with HTML5:•application cache/offline operation [Resources, 10]•the <video> tag [Resources, 11]•geolocation [Resources, 12]Additionally, device implementations MUST support the HTML5/W3C webstorage API [Resources, 13], and SHOULD support the HTML5/W3C IndexedDB API [Resources, 14]. Note that as the web development standards bodies are transitioning to favor IndexedDB over webstorage, IndexedDB is expected to become a required component in a future version of Android.3.5. API Behavioral CompatibilityThe behaviors of each of the API types (managed, soft, native, and web) must be consistent with the preferred implementation of the upstream Android open-source project [Resources, 3]. Some specific areas of compatibility are:•Devices MUST NOT change the behavior or semantics of a standard Intent•Devices MUST NOT alter the lifecycle or lifecycle semantics of a particular type of system component (such as Service, Activity, ContentProvider, etc.)•Devices MUST NOT change the semantics of a standard permissionThe above list is not comprehensive. The Compatibility Test Suite (CTS) tests significant portions of the platform for behavioral compatibility, but not all. It is the responsibility of the implementer to ensure behavioral compatibility with the Android Open Source Project. For this reason, device implementers SHOULD use the source code available via the Android Open Source Project where possible, rather than re-implement significant parts of the system.3.6. API NamespacesAndroid follows the package and class namespace conventions defined by the Java programming language. To ensure compatibility with third-party applications, device implementers MUST NOT make any prohibited modifications (see below) to these package namespaces:•java.*•javax.*•sun.*•android.*•com.android.*Prohibited modifications include:•Device implementations MUST NOT modify the publicly exposed APIs on the Android platform by changing any method or class signatures, or by removing classes or class fields.•Device implementers MAY modify the underlying implementation of the APIs, but such modifications MUST NOT impact the stated behavior and Java-language signature of any publicly exposed APIs.•Device implementers MUST NOT add any publicly exposed elements (such as classes or interfaces, or fields or methods to existing classes or interfaces) to the APIs above.A "publicly exposed element" is any construct which is not decorated with the "@hide" marker as used in the upstream Android source code. In other words, device implementers MUST NOT expose new APIs or alter existing APIs in the namespaces noted above. Device implementers MAY make internal-only modifications, but those modifications MUST NOT be advertised or otherwise exposed to developers.Device implementers MAY add custom APIs, but any such APIs MUST NOT be in a namespace owned by or referring to another organization. For instance, device implementers MUST NOT add APIs to the com.google.* or similar namespace; only Google may do so. Similarly, Google MUST NOT add APIs to other companies' namespaces. Additionally, if a device implementation includes custom APIs outside the standard Android namespace, those APIs MUST be packaged in an Android shared library so that only apps that explicitly use them (via the <uses-library> mechanism) are affected by the increased memory usage of such APIs.If a device implementer proposes to improve one of the package namespaces above (such as by adding useful new functionality to an existing API, or adding a new API), the implementer SHOULD visit and begin the process for contributing changes and code, according to the information on that site.Note that the restrictions above correspond to standard conventions for naming APIs in the Java programming language; this section simply aims to reinforce those conventions and make them binding through inclusion in this compatibility definition.3.7. Virtual Machine CompatibilityDevice implementations MUST support the full Dalvik Executable (DEX) bytecode specification and Dalvik Virtual Machine semantics [Resources, 15].Device implementations with screens classified as medium- or low-density MUST configure Dalvik to allocate at least 16MB of memory to each application. Device implementations with screens classified as high-density or extra-high-density MUST configure Dalvik to allocate at least 24MB of memory to each application. Note that device implementations MAY allocate more memory than these figures.3.8. User Interface Compatibility。

相关文档
最新文档