Kompatibilitätsdefinition für Android 2.2

Copyright © 2010, Google Inc. Alle Rechte vorbehalten.
Kompatibilität@android.com

Inhaltsverzeichnis

1. Einleitung
2. Ressourcen
3. Software
4. Referenz-Softwarekompatibilität
5. Kompatibilität der Anwendungspakete
6. Multimedia-Kompatibilität
7. Kompatibilität mit Entwicklertools
8. Hardwarekompatibilität
9. Leistungskompatibilität
10. Kompatibilität des Sicherheitsmodells
11. Kompatibilitätstestsuite
12. Aktualisierbare Software
13. Kontaktieren Sie uns
Anhang A – Bluetooth-Testverfahren

1. Einleitung

In diesem Dokument werden die Anforderungen aufgeführt, die erfüllt sein müssen, damit Mobiltelefone mit Android 2.2 kompatibel sind.

Die Verwendung von „muss“, „darf nicht“, „erforderlich“, „shall“, „shall not“, „should“, „should not“, „recommended“, „may“ und „optional“ entspricht dem IETF-Standard definiert in RFC2119 [ Ressourcen, 1 ].

Wie in diesem Dokument verwendet, ist ein „Geräteimplementierer“ oder „Implementierer“ eine Person oder Organisation, die eine Hardware-/Softwarelösung mit Android 2.2 entwickelt. Eine „Geräteimplementierung“ oder „Implementierung“ ist die so entwickelte Hardware-/Softwarelösung.

Um als mit Android 2.2 kompatibel zu gelten, sind folgende Geräteimplementierungen erforderlich:

  • MUSS die in dieser Kompatibilitätsdefinition dargelegten Anforderungen erfüllen, einschließlich aller durch Verweis einbezogenen Dokumente.
  • MUSS die aktuellste Version der Android Compatibility Test Suite (CTS) bestehen, die zum Zeitpunkt der Fertigstellung der Geräteimplementierungssoftware verfügbar ist. (Das CTS ist als Teil des Android Open Source Project [ Ressourcen, 2 ] verfügbar.) Das CTS testet viele, aber nicht alle der in diesem Dokument beschriebenen Komponenten.

Wenn diese Definition oder das CTS stillschweigend, mehrdeutig oder unvollständig ist, liegt es in der Verantwortung des Geräteimplementierers, die Kompatibilität mit vorhandenen Implementierungen sicherzustellen. Aus diesem Grund ist das Android Open Source Project [ Ressourcen, 3 ] sowohl die Referenz als auch die bevorzugte Implementierung von Android. Geräteimplementierern wird dringend empfohlen, ihre Implementierungen auf dem „Upstream“-Quellcode zu basieren, der vom Android Open Source Project verfügbar ist. Obwohl einige Komponenten hypothetisch durch alternative Implementierungen ersetzt werden können, wird von dieser Praxis dringend abgeraten, da das Bestehen der CTS-Tests wesentlich schwieriger wird. Es liegt in der Verantwortung des Implementierers, die vollständige Verhaltenskompatibilität mit der Standard-Android-Implementierung sicherzustellen, einschließlich der Compatibility Test Suite und darüber hinaus. Beachten Sie abschließend, dass bestimmte Komponentenersetzungen und -modifikationen in diesem Dokument ausdrücklich verboten sind.

2. Ressourcen

  1. IETF RFC2119-Anforderungsstufen: http://www.ietf.org/rfc/rfc2119.txt
  2. Übersicht über das Android-Kompatibilitätsprogramm: http://source.android.com/docs/compatibility/index.html
  3. Android Open Source-Projekt: http://source.android.com/
  4. API-Definitionen und Dokumentation: http://developer.android.com/reference/packages.html
  5. Referenz zu Android-Berechtigungen: http://developer.android.com/reference/android/Manifest.permission.html
  6. android.os.Build-Referenz: http://developer.android.com/reference/android/os/Build.html
  7. Für Android 2.2 zulässige Versionszeichenfolgen: http://source.android.com/docs/compatibility/2.2/versions.html
  8. android.webkit.WebView-Klasse: http://developer.android.com/reference/android/webkit/WebView.html
  9. HTML5: http://www.whatwg.org/specs/web-apps/current-work/multipage/
  10. Spezifikation der Dalvik Virtual Machine: verfügbar im Android-Quellcode unter dalvik/docs
  11. AppWidgets: http://developer.android.com/guide/practices/ui_guidelines/widget_design.html
  12. Benachrichtigungen: http://developer.android.com/guide/topics/ui/notifiers/notifications.html
  13. Anwendungsressourcen: http://code.google.com/android/reference/available-resources.html
  14. Stilleitfaden für Statusleistensymbole: http://developer.android.com/guide/practices/ui_guideline /icon_design.html#statusbarstructure
  15. Suchmanager: http://developer.android.com/reference/android/app/SearchManager.html
  16. Toasts: http://developer.android.com/reference/android/widget/Toast.html
  17. Live-Hintergründe: https://android-developers.googleblog.com/2010/02/live-wallpapers.html
  18. Apps für Android: http://code.google.com/p/apps-for-android
  19. Dokumentation zum Referenztool (für adb, aapt, ddms): http://developer.android.com/guide/developing/tools/index.html
  20. Beschreibung der Android-Apk-Datei: http://developer.android.com/guide/topics/fundamentals.html
  21. Manifestdateien: http://developer.android.com/guide/topics/manifest/manifest-intro.html
  22. Monkey-Testtool: https://developer.android.com/studio/test/other-testing-tools/monkey
  23. Liste der Android-Hardwarefunktionen: http://developer.android.com/reference/android/content/pm/PackageManager.html
  24. Unterstützung mehrerer Bildschirme: http://developer.android.com/guide/practices/screens_support.html
  25. android.content.res.Configuration: http://developer.android.com/reference/android/content/res/Configuration.html
  26. android.util.DisplayMetrics: http://developer.android.com/reference/android/util/DisplayMetrics.html
  27. android.hardware.Camera: http://developer.android.com/reference/android/hardware/Camera.html
  28. Sensorkoordinatenraum: http://developer.android.com/reference/android/hardware/SensorEvent.html
  29. Referenz zu Android-Sicherheit und -Berechtigungen: http://developer.android.com/guide/topics/security/security.html
  30. Bluetooth-API: http://developer.android.com/reference/android/bluetooth/package-summary.html

Viele dieser Ressourcen stammen direkt oder indirekt vom Android 2.2 SDK und sind funktional identisch mit den Informationen in der Dokumentation dieses SDK. In allen Fällen, in denen diese Kompatibilitätsdefinition oder die Kompatibilitätstestsuite nicht mit der SDK-Dokumentation übereinstimmen, gilt die SDK-Dokumentation als maßgeblich. Alle in den oben aufgeführten Referenzen bereitgestellten technischen Details werden durch die Aufnahme als Teil dieser Kompatibilitätsdefinition betrachtet.

3. Software

Die Android-Plattform umfasst eine Reihe verwalteter APIs, eine Reihe nativer APIs und eine Reihe sogenannter „weicher“ APIs wie das Intent-System und Webanwendungs-APIs. In diesem Abschnitt werden die für die Kompatibilität wesentlichen Hard- und Soft-APIs sowie bestimmte andere relevante technische Verhaltensweisen und Verhaltensweisen der Benutzeroberfläche detailliert beschrieben. Geräteimplementierungen MÜSSEN alle Anforderungen in diesem Abschnitt erfüllen.

3.1. Verwaltete API-Kompatibilität

Die verwaltete (Dalvik-basierte) Ausführungsumgebung ist das primäre Vehikel für Android-Anwendungen. Bei der Android-Anwendungsprogrammierschnittstelle (API) handelt es sich um den Satz von Android-Plattformschnittstellen, die Anwendungen zur Verfügung gestellt werden, die in der verwalteten VM-Umgebung ausgeführt werden. Geräteimplementierungen MÜSSEN vollständige Implementierungen, einschließlich aller dokumentierten Verhaltensweisen, aller dokumentierten APIs bereitstellen, die vom Android 2.2 SDK bereitgestellt werden [ Ressourcen, 4 ].

Geräteimplementierungen DÜRFEN KEINE verwalteten APIs auslassen, API-Schnittstellen oder Signaturen ändern, vom dokumentierten Verhalten abweichen oder No-Ops enthalten, es sei denn, dies ist in dieser Kompatibilitätsdefinition ausdrücklich zulässig.

3.2. Soft-API-Kompatibilität

Zusätzlich zu den verwalteten APIs aus Abschnitt 3.1 enthält Android auch eine bedeutende, nur zur Laufzeit verfügbare „weiche“ API in Form von Dingen wie Absichten, Berechtigungen und ähnlichen Aspekten von Android-Anwendungen, die beim Kompilieren der Anwendung nicht erzwungen werden können. In diesem Abschnitt werden die „weichen“ APIs und Systemverhalten beschrieben, die für die Kompatibilität mit Android 2.2 erforderlich sind. Geräteimplementierungen MÜSSEN alle in diesem Abschnitt aufgeführten Anforderungen erfüllen.

3.2.1. Berechtigungen

Geräteimplementierer MÜSSEN alle Berechtigungskonstanten unterstützen und durchsetzen, wie auf der Berechtigungsreferenzseite [ Ressourcen, 5 ] dokumentiert. Beachten Sie, dass in Abschnitt 10 zusätzliche Anforderungen im Zusammenhang mit dem Android-Sicherheitsmodell aufgeführt sind.

3.2.2. Build-Parameter

Die Android-APIs enthalten eine Reihe von Konstanten in der Klasse android.os.Build [ Ressourcen, 6 ], die das aktuelle Gerät beschreiben sollen. Um konsistente, aussagekräftige Werte über alle Geräteimplementierungen hinweg bereitzustellen, enthält die folgende Tabelle zusätzliche Einschränkungen für die Formate dieser Werte, denen Geräteimplementierungen entsprechen MÜSSEN.

Parameter Kommentare
android.os.Build.VERSION.RELEASE Die Version des aktuell ausgeführten Android-Systems im für Menschen lesbaren Format. Dieses Feld MUSS einen der in [ Ressourcen, 7 ] definierten Zeichenfolgenwerte haben.
android.os.Build.VERSION.SDK Die Version des aktuell ausgeführten Android-Systems in einem Format, auf das Anwendungscode von Drittanbietern zugreifen kann. Für Android 2.2 MUSS dieses Feld den ganzzahligen Wert 8 haben.
android.os.Build.VERSION.INCREMENTAL Ein vom Geräteimplementierer ausgewählter Wert, der den spezifischen Build des aktuell ausgeführten Android-Systems in einem für Menschen lesbaren Format angibt. Dieser Wert DARF NICHT für verschiedene Builds wiederverwendet werden, die Endbenutzern zur Verfügung gestellt werden. Eine typische Verwendung dieses Felds besteht darin, anzugeben, welche Build-Nummer oder welche Quellcodeverwaltungs-Änderungskennung zum Generieren des Builds verwendet wurde. Es gibt keine Anforderungen an das spezifische Format dieses Feldes, außer dass es NICHT NULL oder eine leere Zeichenfolge („“) sein darf.
android.os.Build.BOARD Ein vom Geräteimplementierer ausgewählter Wert, der die spezifische interne Hardware identifiziert, die vom Gerät verwendet wird, in einem für Menschen lesbaren Format. Eine mögliche Verwendung dieses Feldes besteht darin, die spezifische Revision der Platine anzugeben, die das Gerät mit Strom versorgt. Es gibt keine Anforderungen an das spezifische Format dieses Feldes, außer dass es NICHT NULL oder eine leere Zeichenfolge („“) sein darf.
android.os.Build.BRAND Ein vom Geräteimplementierer ausgewählter Wert, der den Namen des Unternehmens, der Organisation, der Person usw. identifiziert, die das Gerät hergestellt haben, in einem für Menschen lesbaren Format. Eine mögliche Verwendung dieses Feldes besteht darin, den OEM und/oder Netzbetreiber anzugeben, der das Gerät verkauft hat. Es gibt keine Anforderungen an das spezifische Format dieses Feldes, außer dass es NICHT NULL oder eine leere Zeichenfolge („“) sein darf.
android.os.Build.DEVICE Ein vom Geräteimplementierer ausgewählter Wert, der die spezifische Konfiguration oder Revision des Gehäuses (manchmal auch „Industriedesign“ genannt) des Geräts identifiziert. Es gibt keine Anforderungen an das spezifische Format dieses Feldes, außer dass es NICHT NULL oder eine leere Zeichenfolge („“) sein darf.
android.os.Build.FINGERPRINT Eine Zeichenfolge, die diesen Build eindeutig identifiziert. Es SOLLTE für Menschen einigermaßen lesbar sein. Es MUSS dieser Vorlage folgen:
$(BRAND)/$(PRODUCT)/$(DEVICE)/$(BOARD):$(VERSION.RELEASE)/$(ID)/$(VERSION.INCREMENTAL):$(TYPE)/$(TAGS)
Zum Beispiel:
acme/mydevice/generic/generic:2.2/ERC77/3359:userdebug/test-keys
Der Fingerabdruck DARF KEINE Leerzeichen enthalten. Wenn andere in der obigen Vorlage enthaltene Felder Leerzeichen enthalten, MÜSSEN diese im Build-Fingerabdruck durch ein anderes Zeichen ersetzt werden, beispielsweise durch den Unterstrich („_“).
android.os.Build.HOST Eine Zeichenfolge, die den Host, auf dem der Build erstellt wurde, in einem für Menschen lesbaren Format eindeutig identifiziert. Es gibt keine Anforderungen an das spezifische Format dieses Feldes, außer dass es NICHT NULL oder eine leere Zeichenfolge („“) sein darf.
android.os.Build.ID Eine vom Geräteimplementierer ausgewählte Kennung, um auf eine bestimmte Version in einem für Menschen lesbaren Format zu verweisen. Dieses Feld kann mit android.os.Build.VERSION.INCREMENTAL identisch sein, SOLLTE jedoch ein ausreichend aussagekräftiger Wert sein, damit Endbenutzer zwischen Software-Builds unterscheiden können. Es gibt keine Anforderungen an das spezifische Format dieses Feldes, außer dass es NICHT NULL oder eine leere Zeichenfolge („“) sein darf.
android.os.Build.MODEL Ein vom Geräteimplementierer ausgewählter Wert, der den Namen des Geräts enthält, wie er dem Endbenutzer bekannt ist. Dies SOLLTE derselbe Name sein, unter dem das Gerät vermarktet und an Endbenutzer verkauft wird. Es gibt keine Anforderungen an das spezifische Format dieses Feldes, außer dass es NICHT NULL oder eine leere Zeichenfolge („“) sein darf.
android.os.Build.PRODUCT Ein vom Geräteimplementierer ausgewählter Wert, der den Entwicklungsnamen oder Codenamen des Geräts enthält. MUSS für Menschen lesbar sein, ist aber nicht unbedingt für die Anzeige durch Endbenutzer gedacht. Es gibt keine Anforderungen an das spezifische Format dieses Feldes, außer dass es NICHT NULL oder eine leere Zeichenfolge („“) sein darf.
android.os.Build.TAGS Eine durch Kommas getrennte Liste von Tags, die vom Geräteimplementierer ausgewählt wurden und den Build weiter unterscheiden. Beispiel: „unsigned,debug“. Dieses Feld DARF NICHT null oder eine leere Zeichenfolge („“) sein, aber ein einzelnes Tag (z. B. „release“) ist in Ordnung.
android.os.Build.TIME Ein Wert, der den Zeitstempel des Buildvorgangs darstellt.
android.os.Build.TYPE Ein vom Geräteimplementierer ausgewählter Wert, der die Laufzeitkonfiguration des Builds angibt. Dieses Feld SOLLTE einen der Werte haben, die den drei typischen Android-Laufzeitkonfigurationen entsprechen: „user“, „userdebug“ oder „eng“.
android.os.Build.USER Ein Name oder eine Benutzer-ID des Benutzers (oder automatisierten Benutzers), der den Build generiert hat. Es gibt keine Anforderungen an das spezifische Format dieses Feldes, außer dass es NICHT NULL oder eine leere Zeichenfolge („“) sein darf.

3.2.3. Absichtskompatibilität

Android verwendet Intents, um eine lose gekoppelte Integration zwischen Anwendungen zu erreichen. In diesem Abschnitt werden Anforderungen im Zusammenhang mit den Absichtsmustern beschrieben, die von Geräteimplementierungen berücksichtigt werden MÜSSEN. Mit „gewürdigt“ ist gemeint, dass der Geräteimplementierer eine Android-Aktivität oder einen Android-Dienst bereitstellen MUSS, der einen passenden Intent-Filter angibt und an jedes angegebene Intent-Muster bindet und das korrekte Verhalten implementiert.

3.2.3.1. Kernanwendungsabsichten

Das Android-Upstream-Projekt definiert eine Reihe von Kernanwendungen, wie z. B. einen Telefonwähler, einen Kalender, ein Kontaktbuch, einen Musikplayer usw. Geräteimplementierer KÖNNEN diese Anwendungen durch alternative Versionen ersetzen.

Allerdings MÜSSEN solche alternativen Versionen dieselben Absichtsmuster berücksichtigen, die vom Upstream-Projekt bereitgestellt werden. Wenn ein Gerät beispielsweise einen alternativen Musikplayer enthält, muss es dennoch das von Drittanbieteranwendungen ausgegebene Intent-Muster zur Auswahl eines Songs berücksichtigen.

Die folgenden Anwendungen gelten als Kernanwendungen des Android-Systems:

  • Tischuhr
  • Browser
  • Kalender
  • Taschenrechner
  • Kamera
  • Kontakte
  • Email
  • Galerie
  • GlobalSearch
  • Startprogramm
  • LivePicker (d. h. die Anwendung zur Auswahl von Live-Hintergründen; kann weggelassen werden, wenn das Gerät Live-Hintergründe nicht unterstützt, gemäß Abschnitt 3.8.5.)
  • Nachrichten (auch bekannt als „Mms“)
  • Musik
  • Telefon
  • Einstellungen
  • Tonaufnahmegerät

Die Kernanwendungen des Android-Systems umfassen verschiedene Aktivitäts- oder Dienstkomponenten, die als „öffentlich“ gelten. Das heißt, das Attribut „android:exported“ kann fehlen oder den Wert „true“ haben.

Für jede Aktivität oder jeden Dienst, der in einer der zentralen Android-System-Apps definiert ist und nicht über ein android:exported-Attribut mit dem Wert „false“ als nicht öffentlich markiert ist, MÜSSEN Geräteimplementierungen eine Komponente desselben Typs enthalten, die denselben Intent-Filter implementiert Muster als Kern-Android-System-App.

Mit anderen Worten: Eine Geräteimplementierung KANN Kern-Apps des Android-Systems ersetzen; Wenn dies jedoch der Fall ist, MUSS die Geräteimplementierung alle Intent-Muster unterstützen, die von jeder zu ersetzenden Kern-App des Android-Systems definiert werden.

3.2.3.2. Absichtsüberschreibungen

Da es sich bei Android um eine erweiterbare Plattform handelt, MÜSSEN Geräteimplementierer zulassen, dass jedes in Abschnitt 3.2.3.1 genannte Absichtsmuster durch Anwendungen von Drittanbietern überschrieben wird. Das Upstream-Android-Open-Source-Projekt erlaubt dies standardmäßig; Geräteimplementierer DÜRFEN KEINE besonderen Privilegien für die Verwendung dieser Intent-Muster durch Systemanwendungen festlegen oder verhindern, dass Anwendungen Dritter sich an diese Muster binden und die Kontrolle über sie übernehmen. Dieses Verbot umfasst insbesondere die Deaktivierung der „Chooser“-Benutzeroberfläche, die es dem Benutzer ermöglicht, zwischen mehreren Anwendungen auszuwählen, die alle dasselbe Intent-Muster verarbeiten.

3.2.3.3. Absichts-Namespaces

Geräteimplementierer DÜRFEN KEINE Android-Komponenten enthalten, die neue Intent- oder Broadcast-Intent-Muster mithilfe einer ACTION, CATEGORY oder einer anderen Schlüsselzeichenfolge im Namespace android.* berücksichtigen. Geräteimplementierer DÜRFEN KEINE Android-Komponenten einschließen, die neue Intent- oder Broadcast-Intent-Muster mithilfe einer ACTION, CATEGORY oder einer anderen Schlüsselzeichenfolge in einem Paketbereich einer anderen Organisation berücksichtigen. Geräteimplementierer DÜRFEN KEINE Absichtsmuster ändern oder erweitern, die von den in Abschnitt 3.2.3.1 aufgeführten Kern-Apps verwendet werden.

Dieses Verbot ist analog zu dem für Java-Sprachklassen in Abschnitt 3.6 festgelegten.

3.2.3.4. Sendeabsichten

Anwendungen von Drittanbietern verlassen sich darauf, dass die Plattform bestimmte Absichten sendet, um sie über Änderungen in der Hardware- oder Softwareumgebung zu informieren. Android-kompatible Geräte MÜSSEN die öffentlichen Sendeabsichten als Reaktion auf entsprechende Systemereignisse übertragen. Broadcast Intents werden in der SDK-Dokumentation beschrieben.

3.3. Native API-Kompatibilität

In Dalvik ausgeführter verwalteter Code kann nativen Code aufrufen, der in der APK-Datei der Anwendung als ELF-SO-Datei bereitgestellt wird, die für die entsprechende Hardwarearchitektur des Geräts kompiliert wurde. Geräteimplementierungen MÜSSEN Unterstützung für Code enthalten, der in der verwalteten Umgebung ausgeführt wird, um nativen Code unter Verwendung der standardmäßigen JNI-Semantik (Java Native Interface) aufzurufen. Die folgenden APIs MÜSSEN für nativen Code verfügbar sein:

  • libc (C-Bibliothek)
  • libm (Mathebibliothek)
  • JNI-Schnittstelle
  • libz (Zlib-Komprimierung)
  • liblog (Android-Protokollierung)
  • Minimale Unterstützung für C++
  • Unterstützung für OpenGL, wie unten beschrieben

Geräteimplementierungen MÜSSEN OpenGL ES 1.0 unterstützen. Geräte ohne Hardwarebeschleunigung MÜSSEN OpenGL ES 1.0 mithilfe eines Software-Renderers implementieren. Geräteimplementierungen SOLLTEN so viel von OpenGL ES 1.1 implementieren, wie die Gerätehardware unterstützt. Geräteimplementierungen SOLLTEN eine Implementierung für OpenGL ES 2.0 bereitstellen, wenn die Hardware auf diesen APIs eine angemessene Leistung erbringen kann.

Diese Bibliotheken MÜSSEN quellkompatibel (dh Header-kompatibel) und binärkompatibel (für eine bestimmte Prozessorarchitektur) mit den vom Android Open Source-Projekt in Bionic bereitgestellten Versionen sein. Da die Bionic-Implementierungen nicht vollständig mit anderen Implementierungen wie der GNU C-Bibliothek kompatibel sind, SOLLTEN Geräteimplementierer die Android-Implementierung verwenden. Wenn Geräteimplementierer eine andere Implementierung dieser Bibliotheken verwenden, MÜSSEN sie Header-, Binär- und Verhaltenskompatibilität sicherstellen.

Geräteimplementierungen MÜSSEN die vom Gerät unterstützte native Application Binary Interface (ABI) über die android.os.Build.CPU_ABI API genau melden. Der ABI MUSS einer der Einträge sein, die in der neuesten Version des Android NDK in der Datei docs/CPU-ARCH-ABIS.txt dokumentiert sind. Beachten Sie, dass zusätzliche Versionen des Android NDK möglicherweise Unterstützung für zusätzliche ABIs einführen.

Die Kompatibilität mit nativem Code ist eine Herausforderung. Aus diesem Grund sollte wiederholt werden, dass Geräteimplementierern SEHR dringend empfohlen wird, die Upstream-Implementierungen der oben aufgeführten Bibliotheken zu verwenden, um die Kompatibilität sicherzustellen.

3.4. Webkompatibilität

Viele Entwickler und Anwendungen verlassen sich für ihre Benutzeroberflächen auf das Verhalten der Klasse android.webkit.WebView [ Ressourcen, 8 ], daher muss die WebView-Implementierung mit allen Android-Implementierungen kompatibel sein. Ebenso ist ein umfassendes Weberlebnis von zentraler Bedeutung für das Android-Benutzererlebnis. Geräteimplementierungen MÜSSEN eine Version von android.webkit.WebView enthalten, die mit der Upstream-Android-Software konsistent ist, und MÜSSEN einen modernen HTML5-fähigen Browser enthalten, wie unten beschrieben.

3.4.1. WebView-Kompatibilität

Die Android Open Source-Implementierung verwendet die WebKit-Rendering-Engine, um android.webkit.WebView zu implementieren. Da es nicht möglich ist, eine umfassende Testsuite für ein Web-Rendering-System zu entwickeln, MÜSSEN Geräteimplementierer den spezifischen Upstream-Build von WebKit in der WebView-Implementierung verwenden. Speziell:

  • Die android.webkit.WebView -Implementierungen von Geräteimplementierungen MÜSSEN auf dem 533.1 WebKit-Build aus dem Upstream-Android-Open-Source-Baum für Android 2.2 basieren. Dieser Build enthält einen bestimmten Satz an Funktionen und Sicherheitskorrekturen für WebView. Geräteimplementierer KÖNNEN Anpassungen an der WebKit-Implementierung vornehmen; Solche Anpassungen DÜRFEN jedoch das Verhalten des WebView, einschließlich des Rendering-Verhaltens, NICHT verändern.
  • Die von WebView gemeldete Benutzeragentenzeichenfolge MUSS in diesem Format vorliegen:
    Mozilla/5.0 (Linux; U; Android $(VERSION); $(LOCALE); $(MODEL) Build/$(BUILD)) AppleWebKit/533.1 (KHTML, like Gecko) Version/4.0 Mobile Safari/533.1
    • Der Wert der Zeichenfolge $(VERSION) MUSS mit dem Wert für android.os.Build.VERSION.RELEASE identisch sein
    • Der Wert der Zeichenfolge $(LOCALE) SOLLTE den ISO-Konventionen für Ländercode und Sprache entsprechen und sich auf das aktuell konfigurierte Gebietsschema des Geräts beziehen
    • Der Wert der Zeichenfolge $(MODEL) MUSS mit dem Wert für android.os.Build.MODEL identisch sein
    • Der Wert der Zeichenfolge $(BUILD) MUSS mit dem Wert für android.os.Build.ID identisch sein

Die WebView-Konfiguration MUSS Unterstützung für die HTML5-Datenbank, den Anwendungscache und Geolocation-APIs umfassen [ Ressourcen, 9 ]. Das WebView MUSS Unterstützung für das HTML5-Tag <video> enthalten. HTML5-APIs MÜSSEN wie alle JavaScript-APIs standardmäßig in einer WebView deaktiviert sein, es sei denn, der Entwickler aktiviert sie explizit über die üblichen Android-APIs.

3.4.2. Browser-Kompatibilität

Geräteimplementierungen MÜSSEN eine eigenständige Browseranwendung für das allgemeine Surfen im Internet durch Benutzer enthalten. Der eigenständige Browser basiert möglicherweise auf einer anderen Browsertechnologie als WebKit. Selbst wenn jedoch eine alternative Browseranwendung ausgeliefert wird, MUSS die Komponente android.webkit.WebView , die Drittanbieteranwendungen bereitgestellt wird, auf WebKit basieren, wie in Abschnitt 3.4.1 beschrieben.

Implementierungen KÖNNEN eine benutzerdefinierte Benutzeragentenzeichenfolge in der eigenständigen Browseranwendung liefern.

Die eigenständige Browseranwendung (unabhängig davon, ob sie auf der Upstream-WebKit-Browseranwendung oder einem Ersatz eines Drittanbieters basiert) SOLLTE möglichst viel HTML5 [ Ressourcen, 9 ] unterstützen. Geräteimplementierungen MÜSSEN mindestens HTML5-Geolokalisierung, Anwendungscache und Datenbank-APIs sowie das <video>-Tag in der eigenständigen Browseranwendung unterstützen.

3.5. API-Verhaltenskompatibilität

Das Verhalten der einzelnen API-Typen (verwaltet, Soft, nativ und Web) muss mit der bevorzugten Implementierung des Upstream-Android-Open-Source-Projekts [ Ressourcen, 3 ] übereinstimmen. Einige spezifische Kompatibilitätsbereiche sind:

  • Geräte DÜRFEN das Verhalten oder die Bedeutung einer Standardabsicht NICHT ändern
  • Geräte DÜRFEN NICHT den Lebenszyklus oder die Lebenszyklussemantik einer bestimmten Art von Systemkomponente (z. B. Dienst, Aktivität, ContentProvider usw.) verändern.
  • Geräte DÜRFEN die Semantik einer bestimmten Berechtigung NICHT ändern

Die obige Liste ist nicht vollständig und es liegt in der Verantwortung der Geräteimplementierer, die Verhaltenskompatibilität sicherzustellen. Aus diesem Grund SOLLTEN Geräteimplementierer nach Möglichkeit den über das Android Open Source Project verfügbaren Quellcode verwenden, anstatt wesentliche Teile des Systems neu zu implementieren.

Die Compatibility Test Suite (CTS) testet wesentliche Teile der Plattform auf Verhaltenskompatibilität, jedoch nicht alle. Es liegt in der Verantwortung des Implementierers, die Verhaltenskompatibilität mit dem Android Open Source Project sicherzustellen.

3.6. API-Namespaces

Android folgt den von der Programmiersprache Java definierten Paket- und Klassen-Namespace-Konventionen. Um die Kompatibilität mit Anwendungen von Drittanbietern sicherzustellen, DÜRFEN Geräteimplementierer KEINE verbotenen Änderungen (siehe unten) an diesen Paket-Namespaces vornehmen:

  • Java.*
  • javax.*
  • Sonne.*
  • Android.*
  • com.android.*

Zu den verbotenen Änderungen gehören:

  • Geräteimplementierungen DÜRFEN die öffentlich zugänglichen APIs auf der Android-Plattform NICHT ändern, indem sie Methoden- oder Klassensignaturen ändern oder Klassen oder Klassenfelder entfernen.
  • Geräteimplementierer KÖNNEN die zugrunde liegende Implementierung der APIs ändern, aber solche Änderungen DÜRFEN KEINE Auswirkungen auf das angegebene Verhalten und die Java-Sprachsignatur von öffentlich zugänglichen APIs haben.
  • Geräteimplementierer DÜRFEN KEINE öffentlich zugänglichen Elemente (wie Klassen oder Schnittstellen oder Felder oder Methoden zu vorhandenen Klassen oder Schnittstellen) zu den oben genannten APIs hinzufügen.

Ein „öffentlich zugängliches Element“ ist jedes Konstrukt, das im ursprünglichen Android-Quellcode nicht mit der Markierung „@hide“ versehen ist. Mit anderen Worten: Geräteimplementierer DÜRFEN KEINE neuen APIs offenlegen oder bestehende APIs in den oben genannten Namespaces ändern. Geräteimplementierer KÖNNEN nur interne Änderungen vornehmen, diese Änderungen DÜRFEN jedoch NICHT angekündigt oder anderweitig den Entwicklern zugänglich gemacht werden.

Geräteimplementierer KÖNNEN benutzerdefinierte APIs hinzufügen, solche APIs DÜRFEN sich jedoch NICHT in einem Namensraum befinden, der einer anderen Organisation gehört oder auf diese verweist. Beispielsweise DÜRFEN Geräteimplementierer KEINE APIs zum com.google.* oder einem ähnlichen Namespace hinzufügen. Nur Google darf dies tun. Ebenso DARF Google KEINE APIs zu den Namespaces anderer Unternehmen hinzufügen.

Wenn ein Geräteimplementierer vorschlägt, einen der oben genannten Paketnamensräume zu verbessern (z. B. durch das Hinzufügen nützlicher neuer Funktionen zu einer vorhandenen API oder das Hinzufügen einer neuen API), SOLLTE der Implementierer source.android.com besuchen und mit dem Prozess zum Einbringen von Änderungen beginnen Code, gemäß den Informationen auf dieser Website.

Beachten Sie, dass die oben genannten Einschränkungen den Standardkonventionen für die Benennung von APIs in der Programmiersprache Java entsprechen; Dieser Abschnitt zielt lediglich darauf ab, diese Konventionen zu stärken und sie durch die Aufnahme in diese Kompatibilitätsdefinition verbindlich zu machen.

3.7. Kompatibilität virtueller Maschinen

Geräteimplementierungen MÜSSEN die vollständige Dalvik Executable (DEX)-Bytecode-Spezifikation und die Dalvik Virtual Machine-Semantik unterstützen [ Ressourcen, 10 ].

Geräteimplementierungen mit Bildschirmen, die als mittlere oder niedrige Dichte klassifiziert sind, MÜSSEN Dalvik so konfigurieren, dass jeder Anwendung mindestens 16 MB Speicher zugewiesen werden. Geräteimplementierungen mit als High-Density klassifizierten Bildschirmen MÜSSEN Dalvik so konfigurieren, dass jeder Anwendung mindestens 24 MB Speicher zugewiesen werden. Beachten Sie, dass Geräteimplementierungen möglicherweise mehr Speicher als diese Zahlen zuweisen.

3.8. Kompatibilität der Benutzeroberfläche

Die Android-Plattform umfasst einige Entwickler-APIs, die es Entwicklern ermöglichen, sich in die Benutzeroberfläche des Systems einzubinden. Geräteimplementierungen MÜSSEN diese Standard-UI-APIs in die von ihnen entwickelten benutzerdefinierten Benutzeroberflächen integrieren, wie unten erläutert.

3.8.1. Widgets

Android definiert einen Komponententyp und eine entsprechende API und einen Lebenszyklus, der es Anwendungen ermöglicht, dem Endbenutzer ein „AppWidget“ zur Verfügung zu stellen [ Ressourcen, 11 ]. Die Android Open Source-Referenzversion enthält eine Launcher-Anwendung mit Elementen der Benutzeroberfläche, mit denen der Benutzer AppWidgets zum Startbildschirm hinzufügen, anzeigen und entfernen kann.

Geräteimplementierer KÖNNEN eine Alternative zum Referenz-Launcher (z. B. Startbildschirm) ersetzen. Alternative Launcher SOLLTEN integrierte Unterstützung für AppWidgets enthalten und Elemente der Benutzeroberfläche verfügbar machen, um AppWidgets direkt im Launcher hinzuzufügen, zu konfigurieren, anzuzeigen und zu entfernen. Alternative Launcher können diese Elemente der Benutzeroberfläche weglassen; Wenn sie jedoch weggelassen werden, MUSS der Geräteimplementierer eine separate Anwendung bereitstellen, auf die über den Launcher zugegriffen werden kann und die es Benutzern ermöglicht, AppWidgets hinzuzufügen, zu konfigurieren, anzuzeigen und zu entfernen.

3.8.2. Benachrichtigungen

Android enthält APIs, die es Entwicklern ermöglichen, Benutzer über wichtige Ereignisse zu benachrichtigen [ Ressourcen, 12 ]. Geräteimplementierer MÜSSEN Unterstützung für jede so definierte Benachrichtigungsklasse bereitstellen; Konkret: Töne, Vibration, Licht und Statusleiste.

Darüber hinaus MUSS die Implementierung alle in den APIs [ Ressourcen, 13 ] oder im Stilleitfaden für Statusleistensymbole [ Ressourcen, 14 ] bereitgestellten Ressourcen (Symbole, Sounddateien usw.) korrekt rendern. Geräteimplementierer KÖNNEN eine alternative Benutzererfahrung für Benachrichtigungen bieten als die Referenz-Android-Open-Source-Implementierung; Allerdings MÜSSEN solche alternativen Benachrichtigungssysteme vorhandene Benachrichtigungsressourcen unterstützen, wie oben beschrieben.

Android enthält APIs [ Ressourcen, 15 ], die es Entwicklern ermöglichen, die Suche in ihre Anwendungen zu integrieren und die Daten ihrer Anwendung in der globalen Systemsuche verfügbar zu machen. Im Allgemeinen besteht diese Funktionalität aus einer einzigen, systemweiten Benutzeroberfläche, die es Benutzern ermöglicht, Abfragen einzugeben, während der Benutzereingabe Vorschläge anzeigt und Ergebnisse anzeigt. Die Android-APIs ermöglichen es Entwicklern, diese Schnittstelle wiederzuverwenden, um eine Suche in ihren eigenen Apps bereitzustellen, und ermöglichen es Entwicklern, Ergebnisse an die gemeinsame Benutzeroberfläche für die globale Suche bereitzustellen.

Geräteimplementierungen MÜSSEN eine einzige, gemeinsame, systemweite Suchbenutzeroberfläche umfassen, die als Reaktion auf Benutzereingaben Echtzeitvorschläge machen kann. Geräteimplementierungen MÜSSEN die APIs implementieren, die es Entwicklern ermöglichen, diese Benutzeroberfläche wiederzuverwenden, um die Suche in ihren eigenen Anwendungen bereitzustellen. Geräteimplementierungen MÜSSEN die APIs implementieren, die es Drittanbieteranwendungen ermöglichen, Vorschläge zum Suchfeld hinzuzufügen, wenn es im globalen Suchmodus ausgeführt wird. Wenn keine Anwendungen von Drittanbietern installiert sind, die diese Funktionalität nutzen, SOLLTE das Standardverhalten darin bestehen, Ergebnisse und Vorschläge von Websuchmaschinen anzuzeigen.

Geräteimplementierungen KÖNNEN alternative Benutzeroberflächen für die Suche bereitstellen, SOLLTEN jedoch eine dedizierte Hard- oder Soft-Suchschaltfläche enthalten, die jederzeit in jeder App verwendet werden kann, um das Such-Framework aufzurufen, mit dem in der API-Dokumentation vorgesehenen Verhalten.

3.8.4. Toasts

Anwendungen können die „Toast“-API (definiert in [ Ressourcen, 16 ]) verwenden, um dem Endbenutzer kurze nichtmodale Zeichenfolgen anzuzeigen, die nach kurzer Zeit verschwinden. Geräteimplementierungen MÜSSEN Toasts von Anwendungen an Endbenutzer gut sichtbar anzeigen.

3.8.5. Live-Hintergründe

Android definiert einen Komponententyp und eine entsprechende API und einen Lebenszyklus, die es Anwendungen ermöglichen, dem Endbenutzer ein oder mehrere „Live-Hintergründe“ anzuzeigen [ Ressourcen, 17 ]. Live-Hintergründe sind Animationen, Muster oder ähnliche Bilder mit eingeschränkten Eingabemöglichkeiten, die als Hintergrundbild hinter anderen Anwendungen angezeigt werden.

Es wird davon ausgegangen, dass Hardware Live-Hintergründe zuverlässig ausführen kann, wenn sie alle Live-Hintergründe ohne Funktionseinschränkungen und mit einer angemessenen Bildrate ohne nachteilige Auswirkungen auf andere Anwendungen ausführen kann. Wenn Einschränkungen in der Hardware dazu führen, dass Hintergrundbilder und/oder Anwendungen abstürzen, nicht richtig funktionieren, übermäßig viel CPU- oder Akkuleistung verbrauchen oder mit unannehmbar niedrigen Bildraten laufen, wird davon ausgegangen, dass die Hardware nicht in der Lage ist, Live-Hintergrundbilder auszuführen. Einige Live-Hintergründe können beispielsweise einen Open GL 1.0- oder 2.0-Kontext verwenden, um ihren Inhalt darzustellen. Das Live-Hintergrundbild wird auf Hardware, die nicht mehrere OpenGL-Kontexte unterstützt, nicht zuverlässig ausgeführt, da die Verwendung eines OpenGL-Kontexts durch das Live-Hintergrundbild möglicherweise mit anderen Anwendungen in Konflikt steht, die ebenfalls einen OpenGL-Kontext verwenden.

Geräteimplementierungen, die Live-Hintergründe wie oben beschrieben zuverlässig ausführen können, SOLLTEN Live-Hintergründe implementieren. Geräteimplementierungen, bei denen Live-Hintergründe wie oben beschrieben nicht zuverlässig ausgeführt werden, DÜRFEN KEINE Live-Hintergründe implementieren.

4. Referenz-Softwarekompatibilität

Device implementers MUST test implementation compatibility using the following open-source applications:

  • Calculator (included in SDK)
  • Lunar Lander (included in SDK)
  • The "Apps for Android" applications [ Resources, 18 ].
  • Replica Island (available in Android Market; only required for device implementations that support with OpenGL ES 2.0)

Each app above MUST launch and behave correctly on the implementation, for the implementation to be considered compatible.

Additionally, device implementations MUST test each menu item (including all sub-menus) of each of these smoke-test applications:

  • ApiDemos (included in SDK)
  • ManualSmokeTests (included in CTS)

Each test case in the applications above MUST run correctly on the device implementation.

5. Application Packaging Compatibility

Device implementations MUST install and run Android ".apk" files as generated by the "aapt" tool included in the official Android SDK [ Resources, 19 ].

Devices implementations MUST NOT extend either the .apk [ Resources, 20 ], Android Manifest [ Resources, 21 ], or Dalvik bytecode [ Resources, 10 ] formats in such a way that would prevent those files from installing and running correctly on other compatible devices. Device implementers SHOULD use the reference upstream implementation of Dalvik, and the reference implementation's package management system.

6. Multimedia Compatibility

Device implementations MUST fully implement all multimedia APIs. Device implementations MUST include support for all multimedia codecs described below, and SHOULD meet the sound processing guidelines described below.

6.1. Media Codecs

Device implementations MUST support the following multimedia codecs. All of these codecs are provided as software implementations in the preferred Android implementation from the Android Open Source Project.

Please note that neither Google nor the Open Handset Alliance make any representation that these codecs are unencumbered by third-party patents. Those intending to use this source code in hardware or software products are advised that implementations of this code, including in open source software or shareware, may require patent licenses from the relevant patent holders.

Audio
Name Encoder Decoder Details File/Container Format
AAC LC/LTP X Mono/Stereo content in any combination of standard bit rates up to 160 kbps and sampling rates between 8 to 48kHz 3GPP (.3gp) and MPEG-4 (.mp4, .m4a). No support for raw AAC (.aac)
HE-AACv1 (AAC+) X
HE-AACv2 (enhanced AAC+) X
AMR-NB X X 4.75 to 12.2 kbps sampled @ 8kHz 3GPP (.3gp)
AMR-WB X 9 rates from 6.60 kbit/s to 23.85 kbit/s sampled @ 16kHz 3GPP (.3gp)
MP3 X Mono/Stereo 8-320Kbps constant (CBR) or variable bit-rate (VBR) MP3 (.mp3)
MIDI X MIDI Type 0 and 1. DLS Version 1 and 2. XMF and Mobile XMF. Support for ringtone formats RTTTL/RTX, OTA, and iMelody Type 0 and 1 (.mid, .xmf, .mxmf). Also RTTTL/RTX (.rtttl, .rtx), OTA (.ota), and iMelody (.imy)
Ogg Vorbis X Ogg (.ogg)
PCM X 8- and 16-bit linear PCM (rates up to limit of hardware) WAVE (.wav)
Image
JPEG X X base+progressive
GIF X
PNG X X
BMP X
Video
H.263 X X 3GPP (.3gp) files
H.264 X 3GPP (.3gp) and MPEG-4 (.mp4) files
MPEG4 Simple Profile X 3GPP (.3gp) file

Note that the table above does not list specific bitrate requirements for most video codecs. The reason for this is that in practice, current device hardware does not necessarily support bitrates that map exactly to the required bitrates specified by the relevant standards. Instead, device implementations SHOULD support the highest bitrate practical on the hardware, up to the limits defined by the specifications.

6.2. Audio Recording

When an application has used the android.media.AudioRecord API to start recording an audio stream, device implementations SHOULD sample and record audio with each of these behaviors:

  • Noise reduction processing, if present, SHOULD be disabled.
  • Automatic gain control, if present, SHOULD be disabled.
  • The device SHOULD exhibit approximately flat amplitude versus frequency characteristics; specifically, ±3 dB, from 100 Hz to 4000 Hz
  • Audio input sensitivity SHOULD be set such that a 90 dB sound power level (SPL) source at 1000 Hz yields RMS of 5000 for 16-bit samples.
  • PCM amplitude levels SHOULD linearly track input SPL changes over at least a 30 dB range from -18 dB to +12 dB re 90 dB SPL at the microphone.
  • Total harmonic distortion SHOULD be less than 1% from 100 Hz to 4000 Hz at 90 dB SPL input level.

Note: while the requirements outlined above are stated as "SHOULD" for Android 2.2, the Compatibility Definition for a future version is planned to change these to "MUST". That is, these requirements are optional in Android 2.2 but will be required by a future version. Existing and new devices that run Android 2.2 Android are very strongly encouraged to meet these requirements in Android 2.2 , or they will not be able to attain Android compatibility when upgraded to the future version.

6.3. Audio Latency

Audio latency is broadly defined as the interval between when an application requests an audio playback or record operation, and when the device implementation actually begins the operation. Many classes of applications rely on short latencies, to achieve real-time effects such sound effects or VOIP communication. Device implementations SHOULD meet all audio latency requirements outlined in this section.

For the purposes of this section:

  • "cold output latency" is defined to be the interval between when an application requests audio playback and when sound begins playing, when the audio system has been idle and powered down prior to the request
  • "warm output latency" is defined to be the interval between when an application requests audio playback and when sound begins playing, when the audio system has been recently used but is currently idle (that is, silent)
  • "continuous output latency" is defined to be the interval between when an application issues a sample to be played and when the speaker physically plays the corresponding sound, while the device is currently playing back audio
  • "cold input latency" is defined to be the interval between when an application requests audio recording and when the first sample is delivered to the application via its callback, when the audio system and microphone has been idle and powered down prior to the request
  • "continuous input latency" is defined to be when an ambient sound occurs and when the sample corresponding to that sound is delivered to a recording application via its callback, while the device is in recording mode

Using the above definitions, device implementations SHOULD exhibit each of these properties:

  • cold output latency of 100 milliseconds or less
  • warm output latency of 10 milliseconds or less
  • continuous output latency of 45 milliseconds or less
  • cold input latency of 100 milliseconds or less
  • continuous input latency of 50 milliseconds or less

Note: while the requirements outlined above are stated as "SHOULD" for Android 2.2, the Compatibility Definition for a future version is planned to change these to "MUST". That is, these requirements are optional in Android 2.2 but will be required by a future version. Existing and new devices that run Android 2.2 Android are very strongly encouraged to meet these requirements in Android 2.2 , or they will not be able to attain Android compatibility when upgraded to the future version.

7. Developer Tool Compatibility

Device implementations MUST support the Android Developer Tools provided in the Android SDK. Specifically, Android-compatible devices MUST be compatible with:

  • Android Debug Bridge (known as adb) [ Resources, 19 ]
    Device implementations MUST support all adb functions as documented in the Android SDK. The device-side adb daemon SHOULD be inactive by default, but there MUST be a user-accessible mechanism to turn on the Android Debug Bridge.
  • Dalvik Debug Monitor Service (known as ddms) [ Resources, 19 ]
    Device implementations MUST support all ddms features as documented in the Android SDK. As ddms uses adb , support for ddms SHOULD be inactive by default, but MUST be supported whenever the user has activated the Android Debug Bridge, as above.
  • Monkey [ Resources, 22 ]
    Device implementations MUST include the Monkey framework, and make it available for applications to use.

8. Hardware Compatibility

Android is intended to support device implementers creating innovative form factors and configurations. At the same time Android developers expect certain hardware, sensors and APIs across all Android device. This section lists the hardware features that all Android 2.2 compatible devices must support.

If a device includes a particular hardware component that has a corresponding API for third-party developers, the device implementation MUST implement that API as defined in the Android SDK documentation. If an API in the SDK interacts with a hardware component that is stated to be optional and the device implementation does not possess that component:

  • class definitions for the component's APIs MUST be present
  • the API's behaviors MUST be implemented as no-ops in some reasonable fashion
  • API methods MUST return null values where permitted by the SDK documentation
  • API methods MUST return no-op implementations of classes where null values are not permitted by the SDK documentation

A typical example of a scenario where these requirements apply is the telephony API: even on non-phone devices, these APIs must be implemented as reasonable no-ops.

Device implementations MUST accurately report accurate hardware configuration information via the getSystemAvailableFeatures() and hasSystemFeature(String) methods on the android.content.pm.PackageManager class. [ Resources, 23 ]

8.1. Display

Android 2.2 includes facilities that perform certain automatic scaling and transformation operations under some circumstances, to ensure that third-party applications run reasonably well on a variety of hardware configurations [ Resources, 24 ]. Devices MUST properly implement these behaviors, as detailed in this section.

For Android 2.2, these are the most common display configurations:

Screen Type Width (Pixels) Height (Pixels) Diagonal Length Range (inches) Screen Size Group Screen Density Group
QVGA 240 320 2.6 - 3.0 Small Low
WQVGA 240 400 3.2 - 3.5 Normal Low
FWQVGA 240 432 3.5 - 3.8 Normal Low
HVGA 320 480 3.0 - 3.5 Normal Medium
WVGA 480 800 3.3 - 4.0 Normal Hoch
FWVGA 480 854 3.5 - 4.0 Normal Hoch
WVGA 480 800 4.8 - 5.5 Large Medium
FWVGA 480 854 5.0 - 5.8 Large Medium

Device implementations corresponding to one of the standard configurations above MUST be configured to report the indicated screen size to applications via the android.content.res.Configuration [ Resources, 24 ] class.

Some .apk packages have manifests that do not identify them as supporting a specific density range. When running such applications, the following constraints apply:

  • Device implementations MUST interpret resources in a .apk that lack a density qualifier as defaulting to "medium" (known as "mdpi" in the SDK documentation.)
  • When operating on a "low" density screen, device implementations MUST scale down medium/mdpi assets by a factor of 0.75.
  • When operating on a "high" density screen, device implementations MUST scale up medium/mdpi assets by a factor of 1.5.
  • Device implementations MUST NOT scale assets within a density range, and MUST scale assets by exactly these factors between density ranges.

8.1.2. Non-Standard Display Configurations

Display configurations that do not match one of the standard configurations listed in Section 8.1.1 require additional consideration and work to be compatible. Device implementers MUST contact Android Compatibility Team as described in Section 13 to obtain classifications for screen-size bucket, density, and scaling factor. When provided with this information, device implementations MUST implement them as specified.

Note that some display configurations (such as very large or very small screens, and some aspect ratios) are fundamentally incompatible with Android 2.2; therefore device implementers are encouraged to contact Android Compatibility Team as early as possible in the development process.

8.1.3. Display Metrics

Device implementations MUST report correct valuesfor all display metrics defined in android.util.DisplayMetrics [ Resources, 26 ].

8.1.4. Declared Screen Support

Applications may indicate which screen sizes they support via the <supports-screens> attribute in the AndroidManifest.xml file. Device implementations MUST correctly honor applications' stated support for small, medium, and large screens, as described in the Android SDK documentation.

8.2. Keyboard

Geräteimplementierungen:

  • MUST include support for the Input Management Framework (which allows third party developers to create Input Management Engines -- ie soft keyboard) as detailed at developer.android.com
  • MUST provide at least one soft keyboard implementation (regardless of whether a hard keyboard is present)
  • MAY include additional soft keyboard implementations
  • MAY include a hardware keyboard
  • MUST NOT include a hardware keyboard that does not match one of the formats specified in android.content.res.Configuration.keyboard [ Resources, 25 ] (that is, QWERTY, or 12-key)

8.3. Non-touch Navigation

Geräteimplementierungen:

  • MAY omit a non-touch navigation options (that is, may omit a trackball, d-pad, or wheel)
  • MUST report the correct value for android.content.res.Configuration.navigation [ Resources, 25 ]

8.4. Screen Orientation

Compatible devices MUST support dynamic orientation by applications to either portrait or landscape screen orientation. That is, the device must respect the application's request for a specific screen orientation. Device implementations MAY select either portrait or landscape orientation as the default.

Devices MUST report the correct value for the device's current orientation, whenever queried via the android.content.res.Configuration.orientation, android.view.Display.getOrientation(), or other APIs.

8.5. Touchscreen input

Geräteimplementierungen:

  • MUST have a touchscreen
  • MAY have either capacative or resistive touchscreen
  • MUST report the value of android.content.res.Configuration [ Resources, 25 ] reflecting corresponding to the type of the specific touchscreen on the device
  • SHOULD support fully independently tracked pointers, if the touchscreen supports multiple pointers

8.6. USB

Geräteimplementierungen:

  • MUST implement a USB client, connectable to a USB host with a standard USB-A port
  • MUST implement the Android Debug Bridge over USB (as described in Section 7)
  • MUST implement the USB mass storage specification, to allow a host connected to the device to access the contents of the /sdcard volume
  • SHOULD use the micro USB form factor on the device side
  • MAY include a non-standard port on the device side, but if so MUST ship with a cable capable of connecting the custom pinout to standard USB-A port
  • SHOULD implement support for the USB Mass Storage specification (so that either removable or fixed storage on the device can be accessed from a host PC)

8.7. Navigation keys

The Home, Menu and Back functions are essential to the Android navigation paradigm. Device implementations MUST make these functions available to the user at all times, regardless of application state. These functions SHOULD be implemented via dedicated buttons. They MAY be implemented using software, gestures, touch panel, etc., but if so they MUST be always accessible and not obscure or interfere with the available application display area.

Device implementers SHOULD also provide a dedicated search key. Device implementers MAY also provide send and end keys for phone calls.

8.8. Wireless Data Networking

Device implementations MUST include support for wireless high-speed data networking. Specifically, device implementations MUST include support for at least one wireless data standard capable of 200Kbit/sec or greater. Examples of technologies that satisfy this requirement include EDGE, HSPA, EV-DO, 802.11g, etc.

If a device implementation includes a particular modality for which the Android SDK includes an API (that is, WiFi, GSM, or CDMA), the implementation MUST support the API.

Devices MAY implement more than one form of wireless data connectivity. Devices MAY implement wired data connectivity (such as Ethernet), but MUST nonetheless include at least one form of wireless connectivity, as above.

8.9. Camera

Device implementations MUST include a rear-facing camera. The included rear-facing camera:

  • MUST have a resolution of at least 2 megapixels
  • SHOULD have either hardware auto-focus, or software auto-focus implemented in the camera driver (transparent to application software)
  • MAY have fixed-focus or EDOF (extended depth of field) hardware
  • MAY include a flash. If the Camera includes a flash, the flash lamp MUST NOT be lit while an android.hardware.Camera.PreviewCallback instance has been registered on a Camera preview surface, unless the application has explicitly enabled the flash by enabling the FLASH_MODE_AUTO or FLASH_MODE_ON attributes of a Camera.Parameters object. Note that this constraint does not apply to the device's built-in system camera application, but only to third-party applications using Camera.PreviewCallback .

Device implementations MUST implement the following behaviors for the camera-related APIs:

  1. If an application has never called android.hardware.Camera.Parameters.setPreviewFormat(int), then the device MUST use android.hardware.PixelFormat.YCbCr_420_SP for preview data provided to application callbacks.
  2. If an application registers an android.hardware.Camera.PreviewCallback instance and the system calls the onPreviewFrame() method when the preview format is YCbCr_420_SP, the data in the byte[] passed into onPreviewFrame() must further be in the NV21 encoding format. (This is the format used natively by the 7k hardware family.) That is, NV21 MUST be the default.

Device implementations MUST implement the full Camera API included in the Android 2.2 SDK documentation [ Resources, 27 ]), regardless of whether the device includes hardware autofocus or other capabilities. For instance, cameras that lack autofocus MUST still call any registered android.hardware.Camera.AutoFocusCallback instances (even though this has no relevance to a non-autofocus camera.)

Device implementations MUST recognize and honor each parameter name defined as a constant on the android.hardware.Camera.Parameters class, if the underlying hardware supports the feature. If the device hardware does not support a feature, the API must behave as documented. Conversely, Device implementations MUST NOT honor or recognize string constants passed to the android.hardware.Camera.setParameters() method other than those documented as constants on the android.hardware.Camera.Parameters . That is, device implementations MUST support all standard Camera parameters if the hardware allows, and MUST NOT support custom Camera parameter types.

Device implementations MAY include a front-facing camera. However, if a device implementation includes a front-facing camera, the camera API as implemented on the device MUST NOT use the front-facing camera by default. That is, the camera API in Android 2.2 is for rear-facing cameras only, and device implementations MUST NOT reuse or overload the API to act on a front-facing camera, if one is present. Note that any custom APIs added by device implementers to support front-facing cameras MUST abide by sections 3.5 and 3.6; for instance, if a custom android.hardware.Camera or Camera.Parameters subclass is provided to support front-facing cameras, it MUST NOT be located in an existing namespace, as described by sections 3.5 and 3.6. Note that the inclusion of a front-facing camera does not meet the requirement that devices include a rear-facing camera.

8.10. Accelerometer

Device implementations MUST include a 3-axis accelerometer and MUST be able to deliver events at 50 Hz or greater. The coordinate system used by the accelerometer MUST comply with the Android sensor coordinate system as detailed in the Android APIs (see [ Resources, 28 ]).

8.11. Compass

Device implementations MUST include a 3-axis compass and MUST be able to deliver events 10 Hz or greater. The coordinate system used by the compass MUST comply with the Android sensor coordinate system as defined in the Android API (see [ Resources, 28 ]).

8.12. GPS

Device implementations MUST include a GPS receiver, and SHOULD include some form of "assisted GPS" technique to minimize GPS lock-on time.

8.13. Telephony

Android 2.2 MAY be used on devices that do not include telephony hardware. That is, Android 2.2 is compatible with devices that are not phones. However, if a device implementation does include GSM or CDMA telephony, it MUST implement the full support for the API for that technology. Device implementations that do not include telephony hardware MUST implement the full APIs as no-ops.

See also Section 8.8, Wireless Data Networking.

8.14. Memory and Storage

Device implementations MUST have at least 92MB of memory available to the kernel and userspace. The 92MB MUST be in addition to any memory dedicated to hardware components such as radio, memory, and so on that is not under the kernel's control.

Device implementations MUST have at least 150MB of non-volatile storage available for user data. That is, the /data partition MUST be at least 150MB.

Beyond the requirements above, device implementations SHOULD have at least 128MB of memory available to kernel and userspace, in addition to any memory dedicated to hardware components that is not under the kernel's control. Device implementations SHOULD have at least 1GB of non-volatile storage available for user data. Note that these higher requirements are planned to become hard minimums in a future version of Android. Device implementations are strongly encouraged to meet these requirements now, or else they may not be eligible for compatibility for a future version of Android.

8.15. Application Shared Storage

Device implementations MUST offer shared storage for applications. The shared storage provided MUST be at least 2GB in size.

Device implementations MUST be configured with shared storage mounted by default, "out of the box". If the shared storage is not mounted on the Linux path /sdcard , then the device MUST include a Linux symbolic link from /sdcard to the actual mount point.

Device implementations MUST enforce as documented the android.permission.WRITE_EXTERNAL_STORAGE permission on this shared storage. Shared storage MUST otherwise be writable by any application that obtains that permission.

Device implementations MAY have hardware for user-accessible removable storage, such as a Secure Digital card. Alternatively, device implementations MAY allocate internal (non-removable) storage as shared storage for apps.

Regardless of the form of shared storage used, the shared storage MUST implement USB mass storage, as described in Section 8.6. As shipped out of the box, the shared storage MUST be mounted with the FAT filesystem.

It is illustrative to consider two common examples. If a device implementation includes an SD card slot to satisfy the shared storage requirement, a FAT-formatted SD card 2GB in size or larger MUST be included with the device as sold to users, and MUST be mounted by default. Alternatively, if a device implementation uses internal fixed storage to satisfy this requirement, that storage MUST be 2GB in size or larger, formatted as FAT, and mounted on /sdcard (or /sdcard MUST be a symbolic link to the physical location if it is mounted elsewhere.)

Device implementations that include multiple shared storage paths (such as both an SD card slot and shared internal storage) SHOULD modify the core applications such as the media scanner and ContentProvider to transparently support files placed in both locations.

8.16. Bluetooth

Device implementations MUST include a Bluetooth transceiver. Device implementations MUST enable the RFCOMM-based Bluetooth API as described in the SDK documentation [ Resources, 30 ]. Device implementations SHOULD implement relevant Bluetooth profiles, such as A2DP, AVRCP, OBEX, etc. as appropriate for the device.

The Compatibility Test Suite includes cases that cover basic operation of the Android RFCOMM Bluetooth API. However, since Bluetooth is a communications protocol between devices, it cannot be fully tested by unit tests running on a single device. Consequently, device implementations MUST also pass the human-driven Bluetooth test procedure described in Appendix A.

9. Performance Compatibility

One of the goals of the Android Compatibility Program is to enable consistent application experience to consumers. Compatible implementations must ensure not only that applications simply run correctly on the device, but that they do so with reasonable performance and overall good user experience. Device implementations MUST meet the key performance metrics of an Android 2.2 compatible device defined in the table below:

Metric Performance Threshold Comments
Application Launch Time The following applications should launch within the specified time.
  • Browser: less than 1300ms
  • MMS/SMS: less than 700ms
  • AlarmClock: less than 650ms
The launch time is measured as the total time to complete loading the default activity for the application, including the time it takes to start the Linux process, load the Android package into the Dalvik VM, and call onCreate.
Simultaneous Applications When multiple applications have been launched, re-launching an already-running application after it has been launched must take less than the original launch time.

10. Security Model Compatibility

Device implementations MUST implement a security model consistent with the Android platform security model as defined in Security and Permissions reference document in the APIs [ Resources, 29 ] in the Android developer documentation. Device implementations MUST support installation of self-signed applications without requiring any additional permissions/certificates from any third parties/authorities. Specifically, compatible devices MUST support the security mechanisms described in the follow sub-sections.

10.1. Permissions

Device implementations MUST support the Android permissions model as defined in the Android developer documentation [ Resources, 29 ]. Specifically, implementations MUST enforce each permission defined as described in the SDK documentation; no permissions may be omitted, altered, or ignored. Implementations MAY add additional permissions, provided the new permission ID strings are not in the android.* namespace.

10.2. UID and Process Isolation

Device implementations MUST support the Android application sandbox model, in which each application runs as a unique Unix-style UID and in a separate process. Device implementations MUST support running multiple applications as the same Linux user ID, provided that the applications are properly signed and constructed, as defined in the Security and Permissions reference [ Resources, 29 ].

10.3. Filesystem Permissions

Device implementations MUST support the Android file access permissions model as defined in as defined in the Security and Permissions reference [ Resources, 29 ].

10.4. Alternate Execution Environments

Device implementations MAY include runtime environments that execute applications using some other software or technology than the Dalvik virtual machine or native code. However, such alternate execution environments MUST NOT compromise the Android security model or the security of installed Android applications, as described in this section.

Alternate runtimes MUST themselves be Android applications, and abide by the standard Android security model, as described elsewhere in Section 10.

Alternate runtimes MUST NOT be granted access to resources protected by permissions not requested in the runtime's AndroidManifest.xml file via the <uses-permission> mechanism.

Alternate runtimes MUST NOT permit applications to make use of features protected by Android permissions restricted to system applications.

Alternate runtimes MUST abide by the Android sandbox model. Specifically:

  • Alternate runtimes SHOULD install apps via the PackageManager into separate Android sandboxes (that is, Linux user IDs, etc.)
  • Alternate runtimes MAY provide a single Android sandbox shared by all applications using the alternate runtime.
  • Alternate runtimes and installed applications using an alternate runtime MUST NOT reuse the sandbox of any other app installed on the device, except through the standard Android mechanisms of shared user ID and signing certificate
  • Alternate runtimes MUST NOT launch with, grant, or be granted access to the sandboxes corresponding to other Android applications.

Alternate runtimes MUST NOT be launched with, be granted, or grant to other applications any privileges of the superuser (root), or of any other user ID.

The .apk files of alternate runtimes MAY be included in the system image of a device implementation, but MUST be signed with a key distinct from the key used to sign other applications included with the device implementation.

When installing applications, alternate runtimes MUST obtain user consent for the Android permissions used by the application. That is, if an application needs to make use of a device resource for which there is a corresponding Android permission (such as Camera, GPS, etc.), the alternate runtime MUST inform the user that the application will be able to access that resource. If the runtime environment does not record application capabilities in this manner, the runtime environment MUST list all permissions held by the runtime itself when installing any application using that runtime.

11. Compatibility Test Suite

Device implementations MUST pass the Android Compatibility Test Suite (CTS) [ Resources, 2 ] available from the Android Open Source Project, using the final shipping software on the device. Additionally, device implementers SHOULD use the reference implementation in the Android Open Source tree as much as possible, and MUST ensure compatibility in cases of ambiguity in CTS and for any reimplementations of parts of the reference source code.

The CTS is designed to be run on an actual device. Like any software, the CTS may itself contain bugs. The CTS will be versioned independently of this Compatibility Definition, and multiple revisions of the CTS may be released for Android 2.2. Device implementations MUST pass the latest CTS version available at the time the device software is completed.

12. Updatable Software

Device implementations MUST include a mechanism to replace the entirety of the system software. The mechanism need not perform "live" upgrades -- that is, a device restart MAY be required.

Any method can be used, provided that it can replace the entirety of the software preinstalled on the device. For instance, any of the following approaches will satisfy this requirement:

  • Over-the-air (OTA) downloads with offline update via reboot
  • "Tethered" updates over USB from a host PC
  • "Offline" updates via a reboot and update from a file on removable storage

The update mechanism used MUST support updates without wiping user data. Note that the upstream Android software includes an update mechanism that satisfies this requirement.

If an error is found in a device implementation after it has been released but within its reasonable product lifetime that is determined in consultation with the Android Compatibility Team to affect the compatibility of thid-party applications, the device implementer MUST correct the error via a software update available that can be applied per the mechanism just described.

13. Contact Us

You can contact the document authors at compatibility@android.com for clarifications and to bring up any issues that you think the document does not cover.

Appendix A - Bluetooth Test Procedure

The Compatibility Test Suite includes cases that cover basic operation of the Android RFCOMM Bluetooth API. However, since Bluetooth is a communications protocol between devices, it cannot be fully tested by unit tests running on a single device. Consequently, device implementations MUST also pass the human-driven Bluetooth test procedure described below.

The test procedure is based on the BluetoothChat sample app included in the Android open-source project tree. The procedure requires two devices:

  • a candidate device implementation running the software build to be tested
  • a separate device implementation already known to be compatible, and of a model from the device implementation being tested -- that is, a "known good" device implementation

The test procedure below refers to these devices as the "candidate" and "known good" devices, respectively.

Setup and Installation

  1. Build BluetoothChat.apk via 'make samples' from an Android source code tree.
  2. Install BluetoothChat.apk on the known-good device.
  3. Install BluetoothChat.apk on the candidate device.

Test Bluetooth Control by Apps

  1. Launch BluetoothChat on the candidate device, while Bluetooth is disabled.
  2. Verify that the candidate device either turns on Bluetooth, or prompts the user with a dialog to turn on Bluetooth.

Test Pairing and Communication

  1. Launch the Bluetooth Chat app on both devices.
  2. Make the known-good device discoverable from within BluetoothChat (using the Menu).
  3. On the candidate device, scan for Bluetooth devices from within BluetoothChat (using the Menu) and pair with the known-good device.
  4. Send 10 or more messages from each device, and verify that the other device receives them correctly.
  5. Close the BluetoothChat app on both devices by pressing Home .
  6. Unpair each device from the other, using the device Settings app.

Test Pairing and Communication in the Reverse Direction

  1. Launch the Bluetooth Chat app on both devices.
  2. Make the candidate device discoverable from within BluetoothChat (using the Menu).
  3. On the known-good device, scan for Bluetooth devices from within BluetoothChat (using the Menu) and pair with the candidate device.
  4. Send 10 or messages from each device, and verify that the other device receives them correctly.
  5. Close the Bluetooth Chat app on both devices by pressing Back repeatedly to get to the Launcher.

Test Re-Launches

  1. Re-launch the Bluetooth Chat app on both devices.
  2. Send 10 or messages from each device, and verify that the other device receives them correctly.

Note: the above tests have some cases which end a test section by using Home, and some using Back. These tests are not redundant and are not optional: the objective is to verify that the Bluetooth API and stack works correctly both when Activities are explicitly terminated (via the user pressing Back, which calls finish()), and implicitly sent to background (via the user pressing Home.) Each test sequence MUST be performed as described.