Android 4.2 Compatibility Definition

Revision 2
Last updated: Feb 17, 2013

Copyright © 2012, Google Inc. All rights reserved.
[email protected]

Table of Contents

1. Introduction
2. Resources
3. Software
3.1. Managed API Compatibility
3.2. Soft API Compatibility
3.3. Native API Compatibility
3.4. Web Compatibility
3.5. API Behavioral Compatibility
3.6. API Namespaces
3.7. Virtual Machine Compatibility
3.8. User Interface Compatibility
3.9 Device Administration
3.10 Accessibility
3.11 Text-to-Speech
4. Application Packaging Compatibility
5. Multimedia Compatibility
6. Developer Tools and Options Compatibility
7. Hardware Compatibility
7.1. Display and Graphics
7.2. Input Devices
7.3. Sensors
7.4. Data Connectivity
7.5. Cameras
7.6. Memory and Storage
7.7. USB
8. Performance Compatibility
9. Security Model Compatibility
10. Software Compatibility Testing
11. Updatable Software
12. Contact Us
Appendix A - Bluetooth Test Procedure

1. Introduction

This document enumerates the requirements that must be met in order for devices to be compatible with Android 4.2.

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 4.2. A "device implementation" or "implementation" is the hardware/software solution so developed.

To be considered compatible with Android 4.2, 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. Resources

  1. IETF RFC2119 Requirement Levels: http://www.ietf.org/rfc/rfc2119.txt
  2. Android Compatibility Program Overview: http://source.android.com/docs/compatibility/index.html
  3. Android Open Source Project: http://source.android.com/
  4. API definitions and documentation: http://developer.android.com/reference/packages.html
  5. Android Permissions reference: http://developer.android.com/reference/android/Manifest.permission.html
  6. android.os.Build reference: http://developer.android.com/reference/android/os/Build.html
  7. Android 4.2 allowed version strings: http://source.android.com/docs/compatibility/4.2/versions.html
  8. Renderscript: http://developer.android.com/guide/topics/graphics/renderscript.html
  9. Hardware Acceleration: http://developer.android.com/guide/topics/graphics/hardware-accel.html
  10. android.webkit.WebView class: http://developer.android.com/reference/android/webkit/WebView.html
  11. HTML5: http://www.whatwg.org/specs/web-apps/current-work/multipage/
  12. HTML5 offline capabilities: http://dev.w3.org/html5/spec/Overview.html#offline
  13. HTML5 video tag: http://dev.w3.org/html5/spec/Overview.html#video
  14. HTML5/W3C geolocation API: http://www.w3.org/TR/geolocation-API/
  15. HTML5/W3C webdatabase API: http://www.w3.org/TR/webdatabase/
  16. HTML5/W3C IndexedDB API: http://www.w3.org/TR/IndexedDB/
  17. Dalvik Virtual Machine specification: available in the Android source code, at dalvik/docs
  18. AppWidgets: http://developer.android.com/guide/practices/ui_guidelines/widget_design.html
  19. Notifications: http://developer.android.com/guide/topics/ui/notifiers/notifications.html
  20. Application Resources: http://code.google.com/android/reference/available-resources.html
  21. Status Bar icon style guide: http://developer.android.com/guide/practices/ui_guidelines/icon_design_status_bar.html
  22. Search Manager: http://developer.android.com/reference/android/app/SearchManager.html
  23. Toasts: http://developer.android.com/reference/android/widget/Toast.html
  24. Themes: http://developer.android.com/guide/topics/ui/themes.html
  25. R.style class: http://developer.android.com/reference/android/R.style.html
  26. Live Wallpapers: https://android-developers.googleblog.com/2010/02/live-wallpapers.html
  27. Android Device Administration: http://developer.android.com/guide/topics/admin/device-admin.html
  28. DevicePolicyManager reference: http://developer.android.com/reference/android/app/admin/DevicePolicyManager.html
  29. Android Accessibility Service APIs: http://developer.android.com/reference/android/accessibilityservice/package-summary.html
  30. Android Accessibility APIs: http://developer.android.com/reference/android/view/accessibility/package-summary.html
  31. Eyes Free project: http://code.google.com/p/eyes-free
  32. Text-To-Speech APIs: http://developer.android.com/reference/android/speech/tts/package-summary.html
  33. Reference tool documentation (for adb, aapt, ddms, systrace): http://developer.android.com/guide/developing/tools/index.html
  34. Android apk file description: http://developer.android.com/guide/topics/fundamentals.html
  35. Manifest files: http://developer.android.com/guide/topics/manifest/manifest-intro.html
  36. Monkey testing tool: https://developer.android.com/studio/test/other-testing-tools/monkey
  37. Android android.content.pm.PackageManager class and Hardware Features List: http://developer.android.com/reference/android/content/pm/PackageManager.html
  38. Supporting Multiple Screens: http://developer.android.com/guide/practices/screens_support.html
  39. android.util.DisplayMetrics: http://developer.android.com/reference/android/util/DisplayMetrics.html
  40. android.content.res.Configuration: http://developer.android.com/reference/android/content/res/Configuration.html
  41. android.hardware.SensorEvent: http://developer.android.com/reference/android/hardware/SensorEvent.html
  42. Bluetooth API: http://developer.android.com/reference/android/bluetooth/package-summary.html
  43. NDEF Push Protocol: http://source.android.com/docs/compatibility/ndef-push-protocol.pdf
  44. MIFARE MF1S503X: http://www.nxp.com/documents/data_sheet/MF1S503x.pdf
  45. MIFARE MF1S703X: http://www.nxp.com/documents/data_sheet/MF1S703x.pdf
  46. MIFARE MF0ICU1: http://www.nxp.com/documents/data_sheet/MF0ICU1.pdf
  47. MIFARE MF0ICU2: http://www.nxp.com/documents/short_data_sheet/MF0ICU2_SDS.pdf
  48. MIFARE AN130511: http://www.nxp.com/documents/application_note/AN130511.pdf
  49. MIFARE AN130411: http://www.nxp.com/documents/application_note/AN130411.pdf
  50. Camera orientation API: http://developer.android.com/reference/android/hardware/Camera.html#setDisplayOrientation(int)
  51. Camera: http://developer.android.com/reference/android/hardware/Camera.html
  52. Android Open Accessories: http://developer.android.com/guide/topics/usb/accessory.html
  53. USB Host API: http://developer.android.com/guide/topics/usb/host.html
  54. Android Security and Permissions reference: http://developer.android.com/guide/topics/security/security.html
  55. Apps for Android: http://code.google.com/p/apps-for-android
  56. Android DownloadManager: http://developer.android.com/reference/android/app/DownloadManager.html
  57. Android File Transfer: http://www.android.com/filetransfer
  58. Android Media Formats: http://developer.android.com/guide/appendix/media-formats.html
  59. HTTP Live Streaming Draft Protocol: http://tools.ietf.org/html/draft-pantos-http-live-streaming-03
  60. NFC Connection Handover: http://www.nfc-forum.org/specs/spec_list/#conn_handover
  61. Bluetooth Secure Simple Pairing Using NFC: http://www.nfc-forum.org/resources/AppDocs/NFCForum_AD_BTSSP_1_0.pdf
  62. Wifi Multicast API: http://developer.android.com/reference/android/net/wifi/WifiManager.MulticastLock.html
  63. Action Assist: http://developer.android.com/reference/android/content/Intent.html#ACTION_ASSIST
  64. USB Charging Specification: http://www.usb.org/developers/devclass_docs/USB_Battery_Charging_1.2.pdf
  65. Android Beam: http://developer.android.com/guide/topics/nfc/nfc.html
  66. Android USB Audio: http://developer.android.com/reference/android/hardware/usb/UsbConstants.html#USB_CLASS_AUDIO
  67. Android NFC Sharing Settings: http://developer.android.com/reference/android/provider/Settings.html#ACTION_NFCSHARING_SETTINGS
  68. Wifi Direct (Wifi P2P): http://developer.android.com/reference/android/net/wifi/p2p/WifiP2pManager.html
  69. Lock and Home Screen Widget: http://developer.android.com/reference/android/appwidget/AppWidgetProviderInfo.html
  70. UserManager reference: http://developer.android.com/reference/android/os/UserManager.html
  71. External Storage reference: https://source.android.com/docs/core/storage
  72. External Storage APIs: http://developer.android.com/reference/android/os/Environment.html
  73. SMS Short Code: http://en.wikipedia.org/wiki/Short_code
  74. Media Remote Control Client: http://developer.android.com/reference/android/media/RemoteControlClient.html
  75. Display Manager: http://developer.android.com/reference/android/hardware/display/DisplayManager.html
  76. Dreams: http://developer.android.com/reference/android/service/dreams/DreamService.html
  77. Android Application Development-Related Settings: http://developer.android.com/reference/android/provider/Settings.html#ACTION_APPLICATION_DEVELOPMENT_SETTINGS
  • Camera: http://developer.android.com/reference/android/hardware/Camera.Parameters.html
  • Many of these resources are derived directly or indirectly from the Android 4.2 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. Software

    3.1. Managed API Compatibility

    The 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 4.2 SDK [Resources, 4].

    Device implementations MUST NOT omit any managed APIs, alter API interfaces or signatures, deviate from the documented behavior, or include no-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 Compatibility

    In 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.

    3.2.1. Permissions

    Device 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 Parameters

    The 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 Comments
    android.os.Build.VERSION.RELEASE The version of the currently-executing Android system, in human-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 4.2, this field MUST have the integer value 17.
    android.os.Build.VERSION.SDK_INT The version of the currently-executing Android system, in a format accessible to third-party application code. For Android 4.2, this field MUST have the integer value 17.
    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 as 7-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.CPU_ABI The name of the instruction set (CPU type + ABI convention) of native code. See Section 3.3: Native API Compatibility.
    android.os.Build.CPU_ABI2 The name of the second instruction set (CPU type + ABI convention) of native code. See