著作権 © 2010、Google Inc. 無断複写・転載を禁じます。
互換性@android.com
1.はじめに
このドキュメントでは、携帯電話が Android 2.1 と互換性を持つために満たす必要がある要件を列挙します。
"must"、"must not"、"required"、"shall"、"shall not"、"should"、"should not"、"recommended"、"may"、および "optional" の使用は、IETF 標準に従っています。 RFC2119 [リソース、1 ] で定義されています。
このドキュメントで使用されている「デバイス実装者」または「実装者」は、Android 2.1 を実行するハードウェア/ソフトウェア ソリューションを開発している個人または組織です。 「デバイス実装」または「実装」は、そのように開発されたハードウェア/ソフトウェア ソリューションです。
Android 2.1 と互換性があると見なされるには、デバイス実装:
- 参照によって組み込まれたドキュメントを含め、この互換性定義に示されている要件を満たさなければなりません。
- デバイス実装のソフトウェアが完成した時点で利用可能な Android 互換性テスト スイート (CTS) の最新バージョンに合格しなければなりません。 (CTS は、Android オープン ソース プロジェクト [参考文献、2 ] の一部として入手できます。) CTS は、このドキュメントで説明されているコンポーネントのすべてではありませんが、多くのコンポーネントをテストします。
この定義または CTS が沈黙、あいまい、または不完全である場合、既存の実装との互換性を確保するのはデバイスの実装者の責任です。このため、Android オープン ソース プロジェクト [ Resources, 3 ] は、Android のリファレンスであり、推奨される実装でもあります。デバイスの実装者は、Android オープン ソース プロジェクトから入手できる「アップストリーム」ソース コードに基づいて実装することを強くお勧めします。一部のコンポーネントは仮想的に別の実装に置き換えることができますが、CTS テストに合格することが大幅に難しくなるため、この方法はお勧めできません。互換性テスト スイートを含め、標準の Android 実装との完全な動作互換性を確保することは、実装者の責任です。最後に、特定のコンポーネントの置換と変更は、このドキュメントでは明示的に禁止されていることに注意してください。
2. リソース
- IETF RFC2119 要件レベル: http://www.ietf.org/rfc/rfc2119.txt
- Android 互換性プログラムの概要: http://source.android.com/compatibility/index.html
- Android オープン ソース プロジェクト: http://source.android.com/
- API の定義とドキュメント: http://developer.android.com/reference/packages.html
- Android 権限リファレンス: http://developer.android.com/reference/android/Manifest.permission.html
- android.os.Build リファレンス: http://developer.android.com/reference/android/os/Build.html
- Android 2.1 で許可されているバージョン文字列: http://source.android.com/compatibility/2.1/versions.html
- android.webkit.WebView クラス: http://developer.android.com/reference/android/webkit/WebView.html
- HTML5: http://www.whatwg.org/specs/web-apps/current-work/multipage/
- Dalvik 仮想マシンの仕様: dalvik/docs の Android ソース コードで入手可能
- AppWidgets: http://developer.android.com/guide/practices/ui_guidelines/widget_design.html
- 通知: http://developer.android.com/guide/topics/ui/notifiers/notifications.html
- アプリケーション リソース: http://code.google.com/android/reference/available-resources.html
- ステータス バー アイコンのスタイル ガイド: http://developer.android.com/guide/practices/ui_guideline /icon_design.html#statusbarstructure
- 検索マネージャー: http://developer.android.com/reference/android/app/SearchManager.html
- トースト: http://developer.android.com/reference/android/widget/Toast.html
- ライブ壁紙: http://developer.android.com/resources/articles/live-wallpapers.html
- Android 用アプリ: http://code.google.com/p/apps-for-android
- 参照ツール ドキュメント (adb、aapt、ddms 用): http://developer.android.com/guide/developing/tools/index.html
- Android apk ファイルの説明: http://developer.android.com/guide/topics/fundamentals.html
- マニフェスト ファイル: http://developer.android.com/guide/topics/manifest/manifest-intro.html
- モンキー テスト ツール: http://developer.android.com/guide/developing/tools/monkey.html
- 複数の画面のサポート: http://developer.android.com/guide/practices/screens_support.html
- android.content.res.Configuration: http://developer.android.com/reference/android/content/res/Configuration.html
- android.util.DisplayMetrics: http://developer.android.com/reference/android/util/DisplayMetrics.html
- android.hardware.Camera: http://developer.android.com/reference/android/hardware/Camera.html
- センサー座標空間: http://developer.android.com/reference/android/hardware/SensorEvent.html
- Android のセキュリティと権限のリファレンス: http://developer.android.com/guide/topics/security/security.html
- Bluetooth API: http://developer.android.com/reference/android/bluetooth/package-summary.html
3. ソフトウェア
3.1.マネージド API の互換性
管理された (Dalvik ベースの) 実行環境は、Android アプリケーションの主要な手段です。 Android アプリケーション プログラミング インターフェース (API) は、マネージド VM 環境で実行されるアプリケーションに公開される一連の Android プラットフォーム インターフェースです。デバイス実装は、Android 2.1 SDK によって公開されている文書化された API の、文書化されたすべての動作を含む完全な実装を提供する必要があります [参考文献、4 ]。
3.2.ソフト API の互換性
3.2.1.権限
デバイスの実装者は、アクセス許可のリファレンス ページ [参考文献、5 ] に記載されているように、すべてのアクセス許可の定数をサポートおよび適用する必要があります。セクション 10 には、Android セキュリティ モデルに関連する追加要件がリストされていることに注意してください。
3.2.2.ビルド パラメータ
Android API には、現在のデバイスを記述するためのandroid.os.Build
クラス [ Resources, 6 ] に多数の定数が含まれています。デバイス実装全体で一貫した意味のある値を提供するために、以下の表には、デバイス実装が準拠しなければならないこれらの値の形式に関する追加の制限が含まれています。
3.2.3.インテントの互換性
3.2.3.1.コア アプリケーションの意図
次のアプリケーションは、コア Android システム アプリケーションと見なされます。
- 卓上時計
- ブラウザ
- カレンダー
- 電卓
- カメラ
- 連絡先
- Eメール
- ギャラリー
- グローバルサーチ
- ランチャー
- LivePicker (つまり、ライブ壁紙ピッカー アプリケーション。セクション 3.8.5 に従って、デバイスがライブ壁紙をサポートしていない場合は省略できます。)
- メッセージング (AKA "Mms")
- 音楽
- 電話
- 設定
- サウンドレコーダー
3.2.3.2.インテントオーバーライド
3.2.3.3.インテント名前空間
この禁止事項は、セクション 3.6 で Java 言語クラスに指定されているものと類似しています。
3.2.3.4.ブロードキャスト インテント
3.3.ネイティブ API の互換性
- libc (C ライブラリ)
- libm (数学ライブラリ)
- JNI インターフェース
- libz (Zlib 圧縮)
- liblog (Android ロギング)
- C++ の最小限のサポート
- 以下で説明する OpenGL のサポート
ネイティブ コードの互換性は困難です。このため、デバイスの実装者は、互換性を確保するために、上記のライブラリのアップストリーム実装を使用することを強くお勧めします。
3.4。 Web API の互換性
多くの開発者とアプリケーションは、ユーザー インターフェイスをandroid.webkit.WebView
クラス [参考文献、8 ] の動作に依存しているため、WebView の実装は Android の実装間で互換性がなければなりません。 Android オープン ソースの実装では、WebKit レンダリング エンジンを使用して WebView を実装します。
- WebView は、Android 2.1 のアップストリーム Android オープン ソース ツリーから 530.17 WebKit ビルドを使用する必要があります。このビルドには、WebView の特定の機能セットとセキュリティ修正が含まれています。
- WebView によって報告されるユーザー エージェント文字列は、次の形式でなければなりません。
Mozilla/5.0 (Linux; U; Android $(VERSION); $(LOCALE); $(MODEL) Build/$(BUILD)) AppleWebKit/530.17 (KHTML, like Gecko) Version/4.0 Mobile Safari/530.17
WebView 構成には、HTML5 データベース、アプリケーション キャッシュ、および地理位置情報 API のサポートが含まれている必要があります [参考文献、9 ]。 WebView には、何らかの形式で HTML5 <video>
タグのサポートが含まれている必要があります。スタンドアロンのブラウザ アプリケーション (アップストリームの WebKit ブラウザ アプリケーションに基づいているか、サードパーティの代替アプリケーションに基づいているかに関係なく) は、WebView 用にリストされた同じ HTML5 機能のサポートを含まなければなりません。
3.5。 API 動作の互換性
各 API タイプ (マネージド、ソフト、ネイティブ、および Web) の動作は、アップストリームの Android オープンソース プロジェクト [参考文献、3 ] の推奨される実装と一致している必要があります。互換性の特定の領域は次のとおりです。
- デバイスは、標準のインテントの動作または意味を変更してはなりません
- デバイスは、特定のタイプのシステム コンポーネント (Service、Activity、ContentProvider など) のライフサイクルまたはライフサイクル セマンティクスを変更してはなりません。
- デバイスは、特定のパーミッションのセマンティクスを変更してはなりません
3.6. API 名前空間
- デバイス実装は、メソッドまたはクラス シグネチャを変更したり、クラスまたはクラス フィールドを削除したりして、Android プラットフォームで公開されている API を変更してはなりません。
- デバイスの実装者は、API の基本的な実装を変更することができますが、そのような変更は、公開されている API の規定の動作や Java 言語の署名に影響を与えてはなりません。
- デバイスの実装者は、公開されている要素 (クラスやインターフェイス、または既存のクラスやインターフェイスへのフィールドやメソッドなど) を上記の API に追加してはなりません。
3.7.仮想マシンの互換性
デバイス実装は、完全な Dalvik Executable (DEX) バイトコード仕様と Dalvik 仮想マシン セマンティクスをサポートしなければなりません [参考文献、10 ]。
3.8。ユーザー インターフェイスの互換性
3.8.1.ウィジェット
Android は、アプリケーションが「AppWidget」をエンド ユーザーに公開できるようにするコンポーネント タイプと、対応する API およびライフサイクルを定義します [参考文献、11 ]。 Android オープン ソース リファレンス リリースには、ユーザーがホーム画面から AppWidgets を追加、表示、および削除できるユーザー インターフェイス要素を含むランチャー アプリケーションが含まれています。
3.8.2.通知
Android には、開発者が重要なイベントをユーザーに通知できるようにする API が含まれています [参考文献、12 ]。デバイスの実装者は、そのように定義された通知の各クラスのサポートを提供する必要があります。具体的には、サウンド、バイブレーション、ライト、ステータス バーです。
さらに、実装は、API [ Resources, 13 ] またはステータス バー アイコン スタイル ガイド [ Resources, 14 ] で提供されるすべてのリソース (アイコン、サウンド ファイルなど) を正しくレンダリングしなければなりません。デバイスの実装者は、参照用の Android オープン ソース実装によって提供されるものとは異なる通知のユーザー エクスペリエンスを提供してもよい (MAY)。ただし、そのような代替通知システムは、上記のように既存の通知リソースをサポートする必要があります。
3.8.3.探す
Android には、開発者が検索をアプリケーションに組み込み、アプリケーションのデータをグローバル システム検索に公開できるようにする API [参考文献、15 ] が含まれています。一般的に言えば、この機能は、ユーザーがクエリを入力し、ユーザーの入力に応じて提案を表示し、結果を表示できる単一のシステム全体のユーザー インターフェイスで構成されます。 Android API を使用すると、開発者はこのインターフェースを再利用して独自のアプリ内で検索を提供したり、共通のグローバル検索ユーザー インターフェースに結果を提供したりできます。
3.8.4.トースト
アプリケーションは、"Toast" API ([ Resources, 16 ] で定義) を使用して、短い非モーダル文字列をエンド ユーザーに表示し、短時間で消えるようにすることができます。デバイス実装は、アプリケーションからエンド ユーザーへのトーストを視認性の高い方法で表示する必要があります。
3.8.5.ライブ壁紙
Android は、アプリケーションが 1 つ以上の「ライブ壁紙」をエンド ユーザーに公開できるようにするコンポーネント タイプと対応する API およびライフサイクルを定義します [参考文献、17 ]。ライブ壁紙は、他のアプリケーションの背後で壁紙として表示される、入力機能が制限されたアニメーション、パターン、または同様の画像です。
上記のようにライブ壁紙を確実に実行できるデバイス実装は、ライブ壁紙を実装する必要があります。上記のようにライブ壁紙を確実に実行しないと判断されたデバイス実装は、ライブ壁紙を実装してはなりません。
4. 参照ソフトウェアの互換性
デバイスの実装者は、次のオープンソース アプリケーションを使用して実装の互換性をテストする必要があります。
上記の各アプリは、実装が互換性があると見なされるために、実装上で正しく起動して動作する必要があります。
さらに、デバイス実装は、これらの各スモーク テスト アプリケーションの各メニュー項目 (すべてのサブメニューを含む) をテストする必要があります。
上記のアプリケーションの各テスト ケースは、デバイス実装で正しく実行する必要があります。
5. アプリケーション パッケージの互換性
デバイス実装は、公式の Android SDK [参考文献、19 ] に含まれる「aapt」ツールによって生成された Android の「.apk」ファイルをインストールして実行する必要があります。
デバイスの実装は、.apk [参考文献、20 ]、Android マニフェスト [参考文献、21 ]、または Dalvik バイトコード [参考文献、10 ] 形式のいずれかを拡張して、それらのファイルが他の互換性のあるデバイスに正しくインストールおよび実行されるのを妨げるような方法で拡張してはなりません (MUST NOT)。 .デバイスの実装者は、Dalvik のリファレンス アップストリーム実装と、リファレンス実装のパッケージ管理システムを使用する必要があります。
6. マルチメディアの互換性
7. 開発者ツールの互換性
デバイス実装は、Android SDK で提供される Android 開発者ツールをサポートしなければなりません。具体的には、Android 互換デバイスは以下と互換性がある必要があります。
- Android Debug Bridge (adb として知られる) [リソース、19 ]
デバイス実装は、Android SDK に記載されているすべてのadb
関数をサポートする必要があります。デバイス側のadb
デーモンはデフォルトで非アクティブにする必要がありますが、Android Debug Bridge をオンにするためのユーザー アクセス可能なメカニズムが必要です。 - Dalvik Debug Monitor Service (ddms として知られる) [リソース、19 ]
Device implementations MUST support allddms
features as documented in the Android SDK. Asddms
usesadb
, support forddms
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
- 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
8.1. Display
Android 2.1 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, 23 ]. Devices MUST properly implement these behaviors, as detailed in this section.
For Android 2.1, this are the most common display configurations:
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.
- 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
8.1.3.指標の表示
Device implementations MUST report correct valuesfor all display metrics defined in android.util.DisplayMetrics
[ Resources, 25 ].
8.2.キーボード
- 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, 24 ] (that is, QWERTY, or 12-key)
8.3.非タッチ ナビゲーション
- 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, 24 ]
8.4.画面の向き
8.5.タッチスクリーン入力
- MUST have a touchscreen
- MAY have either capacative or resistive touchscreen
- MUST report the value of
android.content.res.Configuration
[ Resources, 24 ] reflecting corresponding to the type of the specific touchscreen on the device
8.6. USB
- 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
8.7.ナビゲーション キー
8.8. Wireless Data Networking
8.9. Camera
Device implementations MUST include a camera. The included 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
orFLASH_MODE_ON
attributes of aCamera.Parameters
object. Note that this constraint does not apply to the device's built-in system camera application, but only to third-party applications usingCamera.PreviewCallback
.
Device implementations MUST implement the following behaviors for the camera-related APIs:
- 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.
- 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.1 SDK documentation [ Resources, 26 ]), 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.)
8.10.加速度計
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, 27 ]).
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, 27 ]).
8.12. GPS
8.13.電話
See also Section 8.8, Wireless Data Networking.
8.14.メモリとストレージ
8.15.アプリケーション共有ストレージ
8.16.ブルートゥース
Device implementations MUST include a Bluetooth transceiver. Device implementations MUST enable the RFCOMM-based Bluetooth API as described in the SDK documentation [ Resources, 29 ]. Device implementations SHOULD implement relevant Bluetooth profiles, such as A2DP, AVRCP, OBEX, etc. as appropriate for the device.
9. Performance Compatibility
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, 28 ] 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.権限
Device implementations MUST support the Android permissions model as defined in the Android developer documentation [ Resources, 28 ]. 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 とプロセスの分離
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, 28 ].
10.3.ファイルシステムのアクセス許可
Device implementations MUST support the Android file access permissions model as defined in as defined in the Security and Permissions reference [ Resources, 28 ].
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.
12. Updatable Software
- 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
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.