パフォーマンスの測定
コレクションでコンテンツを整理
必要に応じて、コンテンツの保存と分類を行います。
Android 8.0(API レベル 26)以降では、一部のメディアクラスで getMetrics()
メソッドを使用できます。属性と値のマップとして表現される、構成とパフォーマンスの情報を含む PersistableBundle
オブジェクトを返します。getMetrics()
メソッドは、以下のメディアクラスに定義されています。
指標はインスタンスごとに収集され、インスタンスの存続する間維持されます。使用可能な指標がない場合、メソッドは null を返します。実際に返される指標は、クラスによって異なります。
ExoPlayer による分析
ExoPlayer には、再生データの収集と処理に役立つツールが含まれています。詳しくは、分析に関するデベロッパー ガイドをご覧ください。
このページのコンテンツやコードサンプルは、コンテンツ ライセンスに記載のライセンスに従います。Java および OpenJDK は Oracle および関連会社の商標または登録商標です。
最終更新日 2025-07-27 UTC。
[[["わかりやすい","easyToUnderstand","thumb-up"],["問題の解決に役立った","solvedMyProblem","thumb-up"],["その他","otherUp","thumb-up"]],[["必要な情報がない","missingTheInformationINeed","thumb-down"],["複雑すぎる / 手順が多すぎる","tooComplicatedTooManySteps","thumb-down"],["最新ではない","outOfDate","thumb-down"],["翻訳に関する問題","translationIssue","thumb-down"],["サンプル / コードに問題がある","samplesCodeIssue","thumb-down"],["その他","otherDown","thumb-down"]],["最終更新日 2025-07-27 UTC。"],[],[],null,["# Measuring performance\n\nIn Android 8.0 (API level 26) and later, the `getMetrics()` method is available\nfor some media classes. It returns a\n[PersistableBundle](/reference/android/os/PersistableBundle)\nobject containing configuration\nand performance information, expressed as a map of attributes and values.\nThe `getMetrics()` method is defined for these media classes:\n\n- [MediaPlayer.getMetrics()](/reference/android/media/MediaPlayer#getMetrics())\n- [MediaRecorder.getMetrics()](/reference/android/media/MediaRecorder#getMetrics())\n- [MediaCodec.getMetrics()](/reference/android/media/MediaCodec#getMetrics())\n- [MediaExtractor.getMetrics()](/reference/android/media/MediaExtractor#getMetrics())\n\nMetrics are collected separately for each instance and persist for the\nlifetime of the instance. If no metrics are available the method returns\nnull. The actual metrics returned depend on the class.\n\nAnalytics with ExoPlayer\n------------------------\n\nExoPlayer includes tools to help you collect and process playback data. Learn\nmore in the developer guide for\n[analytics](/guide/topics/media/exoplayer/analytics)."]]