下位互換性のある UI を作成する
コレクションでコンテンツを整理
必要に応じて、コンテンツの保存と分類を行います。
このクラスでは、Android の新しいバージョンで利用可能な UI コンポーネントと API を下位互換性のある方法で使用し、古いバージョンのプラットフォームでのアプリの実行を保証する方法を示します。
このクラス全体を通して、Android 3.0(API レベル 11)で新たに導入されたアクションバー タブ機能をガイド例として使用しますが、他の UI コンポーネントと API 機能にも同じ手法を適用できます。
レッスン
- 新しい API を抽象化する
- アプリに必要な機能と API を決定します。UI コンポーネントの実装をアプリ用に抽象化するアプリ固有の Java 仲介インターフェースを定義する方法を学びます。
- 新しい API をプロキシする
- 新しい API を使用するインターフェースの実装を作成する方法を学習します。
- 古い API を使用する実装を作成する
- 古い API を使用するインターフェースのカスタム実装を作成する方法を学習します。
- バージョン対応コンポーネントを使用する
- 実行時に使用する実装を選択する方法を学習し、アプリでインターフェースの使用を開始します。
関連ドキュメント
このページのコンテンツやコードサンプルは、コンテンツ ライセンスに記載のライセンスに従います。Java および OpenJDK は Oracle および関連会社の商標または登録商標です。
最終更新日 2024-02-22 UTC。
[null,null,["最終更新日 2024-02-22 UTC。"],[],[],null,["# Create backward-compatible UIs\n\nThis class demonstrates how to use UI components and APIs available in newer versions of Android in a backward-compatible way, ensuring that your application still runs on previous versions of the platform.\n\nThroughout this class, the new [Action Bar Tabs](/guide/topics/ui/actionbar#Tabs) feature introduced in Android 3.0 (API level 11) serves as the guiding example, but you can apply these techniques to other UI components and API features.\n\nLessons\n-------\n\n**[Abstract the new APIs](/training/backward-compatible-ui/abstracting)**\n: Determine which features and APIs your application needs. Learn how to define application-specific, intermediary Java interfaces that abstract the implementation of the UI component to your application.\n\n**[Proxy to the new APIs](/training/backward-compatible-ui/new-implementation)**\n: Learn how to create an implementation of your interface that uses newer APIs.\n\n**[Create an implementation with older APIs](/training/backward-compatible-ui/older-implementation)**\n: Learn how to create a custom implementation of your interface that uses older APIs.\n\n**[Use the version-aware component](/training/backward-compatible-ui/using-component)**\n: Learn how to choose an implementation to use at runtime, and begin using the interface in your application.\n\n### You should also read\n\n- [How to have your (Cup)cake and eat it too](http://android-developers.blogspot.com/2010/07/how-to-have-your-cupcake-and-eat-it-too.html)"]]