Android 15 では、デベロッパー向けに優れた新しい機能と API が導入されています。以下のセクションでは、関連する API の使用を開始するにあたって役立つ機能の概要を示します。
新しい API、変更した API、削除された API の詳細なリストについては、API 差分レポートをご覧ください。新しい API について詳しくは、Android API リファレンスをご覧ください。新しい API は、見つけやすいようにハイライト表示されています。また、プラットフォームの変更がアプリに影響する領域については、Android 15 の Android 15 をターゲットとするアプリに影響する動作変更と、targetSdkVersion
に関係なくすべてのアプリに影響する動作変更をご確認ください。カメラとメディア
Android 15 には、カメラとメディアのエクスペリエンスを向上させるさまざまな機能が搭載されています。これにより、クリエイターが Android でビジョンを具現化できるよう、ツールやハードウェアにアクセスできるようになります。
ローライト ブースト
Android 15 introduces Low Light Boost, a new auto-exposure mode available to both Camera 2 and the night mode camera extension. Low Light Boost adjusts the exposure of the Preview stream in low-light conditions. This is different from how the night mode camera extension creates still images, because night mode combines a burst of photos to create a single, enhanced image. While night mode works very well for creating a still image, it can't create a continuous stream of frames, but Low Light Boost can. Thus, Low Light Boost enables new camera capabilities, such as:
- Providing an enhanced image preview, so users are better able to frame their low-light pictures
- Scanning QR codes in low light
If you enable Low Light Boost, it automatically turns on when there's a low light level, and turns off when there's more light.
Apps can record off the Preview stream in low-light conditions to save a brightened video.
For more information, see Low Light Boost.
アプリ内カメラ コントロール
Android 15 では、サポート対象デバイスのカメラ ハードウェアとアルゴリズムをより詳細に制御するための新しい拡張機能が追加されています。
HDR ヘッドルーム コントロール
Android 15 chooses HDR headroom that is appropriate for the underlying device
capabilities and bit-depth of the panel. For pages that have lots of SDR
content, such as a messaging app displaying a single HDR thumbnail, this
behavior can end up adversely influencing the perceived brightness of the SDR
content. Android 15 lets you control the HDR headroom with
setDesiredHdrHeadroom
to strike a balance between SDR
and HDR content.
ラウドネス コントロール
Android 15 では、CTA-2075 ラウドネス標準のサポートが導入されています。これにより、オーディオのラウドネスの不整合を回避し、コンテンツを切り替えるときに音量を絶えず調整する必要がなくなります。システムは、出力デバイス(ヘッドフォンとスピーカー)の既知の特性と、AAC オーディオ コンテンツで利用可能なラウドネス メタデータを利用して、オーディオの音量とダイナミック レンジの圧縮レベルをインテリジェントに調整します。
この機能を有効にするには、AAC コンテンツでラウドネス メタデータが利用できることを確認し、アプリでプラットフォーム機能を有効にする必要があります。そのためには、関連付けられた AudioTrack
のオーディオ セッション ID で create ファクトリ メソッドを呼び出して、LoudnessCodecController
オブジェクトをインスタンス化します。これにより、オーディオの更新が自動的に適用されるようになります。OnLoudnessCodecUpdateListener
を渡して、MediaCodec
に適用する前にラウドネス パラメータを変更またはフィルタできます。
// Media contains metadata of type MPEG_4 OR MPEG_D
val mediaCodec = …
val audioTrack = AudioTrack.Builder()
.setSessionId(sessionId)
.build()
...
// Create new loudness controller that applies the parameters to the MediaCodec
try {
val lcController = LoudnessCodecController.create(mSessionId)
// Starts applying audio updates for each added MediaCodec
AndroidX media3 ExoPlayer はまもなく更新され、シームレスなアプリ統合のために LoudnessCodecController
API を利用するようになります。
仮想 MIDI 2.0 デバイス
Android 13 では、Universal MIDI Packets(UMP)を使用して通信する USB を使用して MIDI 2.0 デバイスに接続するためのサポートが追加されました。Android 15 では、UMP のサポートが仮想 MIDI アプリに拡張されています。これにより、合成アプリは USB MIDI 2.0 デバイスの場合と同様に、シンセサイザー アプリを仮想 MIDI 2.0 デバイスとして制御できます。
接続性
Android 15 ではプラットフォームが更新され、最新の通信機能をアプリが利用できるようになります。
衛星のサポート
Android 15 continues to extend platform support for satellite connectivity and includes some UI elements to ensure a consistent user experience across the satellite connectivity landscape.
Apps can use ServiceState.isUsingNonTerrestrialNetwork()
to
detect when a device is connected to a satellite, giving them more awareness of
why full network services might be unavailable. Additionally, Android 15
provides support for SMS and MMS apps as well as preloaded RCS apps to use
satellite connectivity for sending and receiving messages.
NFC 操作がよりスムーズに
Android 15 では、Android の堅牢な NFC アプリ エコシステムを引き続きサポートしながら、タッチ決済のエクスペリエンスをよりシームレスで信頼性の高いものにするよう努めています。サポートされているデバイスでは、アプリは NfcAdapter
に対して、監視モードに入るようリクエストできます。このモードでは、デバイスはリッスンするが NFC リーダーには応答せず、アプリの NFC サービスの PollingFrame
オブジェクトを送信して処理します。PollingFrame
オブジェクトを使用すると、NFC リーダーへの最初の通信に先立って認証を行うことができます。これにより、多くの場合、ワンタップのトランザクションが可能になります。
さらに、サポート対象のデバイスでアプリの指紋を登録して、ポーリング ループ アクティビティを通知できるようになりました。これにより、複数の NFC 対応アプリでのスムーズな操作が可能になります。
ウォレットの役割
Android 15 introduces a new Wallet role that allows tighter integration with the user's preferred wallet app. This role replaces the NFC default contactless payment setting. Users can manage the Wallet role holder by navigating to Settings > Apps > Default Apps.
The Wallet role is used when routing NFC taps for AIDs registered in the payment category. Taps always go to the Wallet role holder unless another app that is registered for the same AID is running in the foreground.
This role is also used to determine where the Wallet QuickAccess tile should go when activated. When the role is set to "None", the QuickAccess tile isn't available and payment category NFC taps are only delivered to the foreground app.
デベロッパーの生産性とツール
生産性を向上させるための Google の取り組みのほとんどは Android Studio、Jetpack Compose、Android Jetpack ライブラリなどのツールを中心に据えていますが、Google はビジョンの実現を容易にする方法を常に模索しています。
PDF の改善
Android 15 includes substantial improvements to the PdfRenderer
APIs. Apps can incorporate advanced features such as rendering
password-protected files, annotations, form editing,
searching, and selection with copy. Linearized PDF
optimizations are supported to speed local PDF viewing and reduce resource use.
The PdfRenderer
has been moved to a module that can be updated using Google
Play system updates independent of the platform release, and we're supporting
these changes back to Android 11 (API level 30) by creating a compatible
pre-Android 15 version of the API surface, called
PdfRendererPreV
.
We value your feedback on the enhancements we've made to the PdfRenderer
API
surface, and we plan to make it even easier to incorporate these APIs into your
app with an upcoming Android Jetpack library.
言語の自動切り替えの改良
Android 14 added on-device, multi-language recognition in audio with automatic
switching between languages, but this can cause words to get dropped,
especially when languages switch with less of a pause between the two
utterances. Android 15 adds additional controls to help apps tune this switching
to their use case.
EXTRA_LANGUAGE_SWITCH_INITIAL_ACTIVE_DURATION_TIME_MILLIS
confines the automatic switching to the beginning of the audio session, while
EXTRA_LANGUAGE_SWITCH_MATCH_SWITCHES
deactivates the
language switching after a defined number of switches. These options are
particularly useful if you expect that there will be a single language spoken
during the session that should be autodetected.
細かな改行コントロール
Android 15 以降では、TextView
とその基になる改行を挿入して、読みやすくするために、同じ行の指定された部分を保持できます。この改行のカスタマイズを利用するには、文字列リソースで <nobreak>
タグを使用するか、createNoBreakSpan
を使用します。同様に、<nohyphen>
タグまたは createNoHyphenationSpan
を使用すると、ハイフンでつないだ単語を保持できます。
たとえば、次の文字列リソースには改行がなく、「Google Pixel 8 Pro」というテキストで不適切な位置で改行されます。
<resources>
<string name="pixel8pro">The power and brains behind Pixel 8 Pro.</string>
</resources>
一方、この文字列リソースには <nobreak>
タグが含まれています。このタグは「Google Pixel 8 Pro」というフレーズを囲み、改行を防ぎます。
<resources>
<string name="pixel8pro">The power and brains behind <nobreak>Pixel 8 Pro.</nobreak></string>
</resources>
これらの文字列のレンダリング方法の違いを次の画像に示します。
OpenJDK 17 の更新
Android 15 では、最新の OpenJDK LTS リリースの機能に合わせて Android のコアライブラリを更新する取り組みが引き続き行われています。
主な機能と改善点は次のとおりです。
- NIO バッファに関する品質向上
- ストリーム
- 追加の
math
メソッドとstrictmath
メソッド util
パッケージの更新(順序付けられたcollection
、map
、set
を含む)Deflater
でのByteBuffer
サポートX500PrivateCredential
やセキュリティ キーのアップデートなどのセキュリティ アップデート
これらの API は、Google Play システム アップデートを通じて Android 12(API レベル 31)以降を搭載した 10 億台を超えるデバイスで更新されるため、最新のプログラミング機能をターゲットにできます。
Java および OpenJDK は、Oracle およびその関連会社の商標または登録商標です。
アプリのアーカイブ
Android と Google Play は昨年、アプリのアーカイブのサポートを発表しました。これにより、Google Play で Android App Bundle を使用して公開された、使用頻度の低いアプリをデバイスから部分的に削除して、空き容量を増やすことができます。Android 15 では、アプリのアーカイブとアーカイブ解除の OS レベルのサポートが追加され、すべてのアプリストアでより簡単に実装できるようになりました。
REQUEST_DELETE_PACKAGES
権限を持つアプリは、PackageInstaller
requestArchive
メソッドを呼び出して、インストール済みのアプリ パッケージのアーカイブをリクエストできます。これにより、APK とキャッシュに保存されたファイルが削除されますが、ユーザーデータは保持されます。アーカイブされたアプリは、LauncherApps
API を通じて表示可能なアプリとして返されます。ユーザーには、それらのアプリがアーカイブされていることを示す UI 処理が表示されます。ユーザーがアーカイブされたアプリをタップすると、担当インストーラがそのアプリのアーカイブ解除リクエストを受け取ります。復元プロセスは、ACTION_PACKAGE_ADDED
ブロードキャストによってモニタリングできます。
ユーザー補助
Android 15 には、ユーザーのユーザー補助機能を向上させる機能が追加されています。
点字の改善
Android 15 では、USB とセキュアな Bluetooth の両方で HID 標準を使用する点字ディスプレイを TalkBack でサポートできるようになりました。
マウスやキーボードで使用されている標準規格と同様に、Android は今後、より幅広い種類の点字ディスプレイをサポートするようになります。
大画面とフォーム ファクタ
Android 15 は、大画面、フリップ式、折りたたみ式デバイスなど、Android のフォーム ファクタを最大限に活用するためのサポートをアプリに提供します。
カバー画面のサポート
アプリは、サポートされているフリップ式デバイスの小さなカバー画面に Application
または Activity
を表示できるように、Android 15 で使用されるプロパティを宣言できます。これらの画面は小さすぎるため、Android アプリの実行可能なターゲットとして見なされませんが、アプリでサポートをオプトインすることで、より多くの場所でアプリを利用できるようになります。
パフォーマンスとバッテリー
Android は、引き続きアプリのパフォーマンスと品質の改善のサポートに重点を置いています。Android 15 では、アプリ内のタスクの実行、アプリのパフォーマンスの最適化、アプリに関する分析情報の収集に役立つ新しい API が導入されています。
ApplicationStartInfo API
以前のバージョンの Android では、アプリの起動が少し謎でした。アプリ内で、コールド状態、ウォーム状態、ホット状態のうちどれで開始されたのかを判断するのが困難でした。また、プロセスのフォーク、onCreate
の呼び出し、最初のフレームの描画など、さまざまなリリース フェーズにアプリが費やした時間を把握するのも困難でした。Application
クラスがインスタンス化された時点では、アプリがブロードキャスト、コンテンツ プロバイダ、ジョブ、バックアップ、起動完了、アラーム、Activity
のどれから開始されたかを知る方法がありませんでした。
Android 15 の ApplicationStartInfo
API は、これらすべてを提供します。独自のタイムスタンプをフローに追加して、タイミング データを 1 か所に収集することもできます。ApplicationStartInfo
を使用すると、指標を収集するだけでなく、アプリの起動を直接最適化することもできます。たとえば、ブロードキャストによってアプリが起動したときに、Application
クラス内で UI 関連ライブラリのインスタンス化のコストがかからなくなります。
アプリサイズの詳細情報
Since Android 8.0 (API level 26), Android has included the
StorageStats.getAppBytes
API that summarizes the installed
size of an app as a single number of bytes, which is a sum of the APK size, the
size of files extracted from the APK, and files that were generated on the
device such as ahead-of-time (AOT) compiled code. This number is not very
insightful in terms of how your app is using storage.
Android 15 adds the
StorageStats.getAppBytesByDataType([type])
API, which lets
you get insight into how your app is using up all that space, including APK file
splits, AOT and speedup related code, dex metadata, libraries, and guided
profiles.
アプリ管理プロファイリング
Android 15 には、アプリ内からプロファイリング情報を収集できる新しい ProfilingManager
クラスが含まれています。プロファイリング リクエストの作成を簡素化する Android Jetpack API でこれをラップする予定ですが、コア API ではヒープダンプ、ヒープ プロファイル、スタック サンプリングなどの収集が可能になります。出力ファイルを識別するタグで指定されたコールバックをアプリに提供します。出力ファイルは、アプリのファイル ディレクトリに配信されます。パフォーマンスへの影響を最小限に抑えるために、API はレート制限を行います。
SQLite データベースの改善
Android 15 では、基盤となる SQLite エンジンの高度な機能を公開する新しい SQLite API が導入されています。これらの API は、アプリに現れる特定のパフォーマンス問題を対象としています。
デベロッパーは、特に大規模なデータベースを扱う場合や、レイテンシの影響を受けやすいクエリを実行する場合は、SQLite のパフォーマンスに関するベスト プラクティスを参照して SQLite データベースを最大限に活用する必要があります。
- 読み取り専用の遅延トランザクション: 読み取り専用のトランザクション(書き込みステートメントを含まない)を発行する場合は、
beginTransactionReadOnly()
とbeginTransactionWithListenerReadOnly(SQLiteTransactionListener)
を使用して読み取り専用のDEFERRED
トランザクションを発行します。このようなトランザクションは相互に同時に実行でき、データベースが WAL モードの場合、IMMEDIATE
またはEXCLUSIVE
トランザクションと同時に実行できます。 - 行数と ID: 追加のクエリを発行せずに、変更された行の数または最後に挿入された行 ID を取得できる新しい API が追加されました。
getLastChangedRowCount()
は、現在のトランザクション内の最新の SQL ステートメントによって挿入、更新、削除された行数を返します。getTotalChangedRowCount()
は現在の接続の数を返します。getLastInsertRowId()
は、現在の接続に挿入される最後の行のrowid
を返します。 - 未加工ステートメント: 未処理の SQlite ステートメントを発行し、コンビニエンス ラッパーや追加の処理オーバーヘッドをバイパスします。
Android Dynamic Performance Framework のアップデート
Android 15 continues our investment in the Android Dynamic Performance Framework (ADPF), a set of APIs that allow games and performance intensive apps to interact more directly with power and thermal systems of Android devices. On supported devices, Android 15 will add new ADPF capabilities:
- A power-efficiency mode for hint sessions to indicate that their associated threads should prefer power saving over performance, great for long-running background workloads.
- GPU and CPU work durations can both be reported in hint sessions, allowing the system to adjust CPU and GPU frequencies together to best meet workload demands.
- Thermal headroom thresholds to interpret possible thermal throttling status based on headroom prediction.
To learn more about how to use ADPF in your apps and games, head over to the documentation.
プライバシー
Android 15 には、アプリ デベロッパーがユーザーのプライバシーを保護するために役立つさまざまな機能が用意されています。
画面録画の検出
Android 15 adds support for apps to detect that they are being recorded. A callback is invoked whenever the app transitions between being visible or invisible within a screen recording. An app is considered visible if activities owned by the registering process's UID are being recorded. This way, if your app is performing a sensitive operation, you can inform the user that they're being recorded.
val mCallback = Consumer<Int> { state ->
if (state == SCREEN_RECORDING_STATE_VISIBLE) {
// We're being recorded
} else {
// We're not being recorded
}
}
override fun onStart() {
super.onStart()
val initialState =
windowManager.addScreenRecordingCallback(mainExecutor, mCallback)
mCallback.accept(initialState)
}
override fun onStop() {
super.onStop()
windowManager.removeScreenRecordingCallback(mCallback)
}
IntentFilter 機能の拡張
Android 15 builds in support for more precise Intent
resolution through
UriRelativeFilterGroup
, which contains a set of
UriRelativeFilter
objects that form a set of Intent
matching rules that must each be satisfied, including URL query parameters, URL
fragments, and blocking or exclusion rules.
These rules can be defined in the AndroidManifest
XML file with the new
<uri-relative-filter-group>
tag, which can optionally include an
android:allow
tag. These tags can contain <data>
tags that use existing data
tag attributes as well as the new android:query
and android:fragment
attributes.
Here's an example of the AndroidManifest
syntax:
<intent-filter>
<action android:name="android.intent.action.VIEW" />
<category android:name="android.intent.category.BROWSABLE" />
<data android:scheme="http" />
<data android:scheme="https" />
<data android:domain="astore.com" />
<uri-relative-filter-group>
<data android:pathPrefix="/auth" />
<data android:query="region=na" />
</uri-relative-filter-group>
<uri-relative-filter-group android:allow="false">
<data android:pathPrefix="/auth" />
<data android:query="mobileoptout=true" />
</uri-relative-filter-group>
<uri-relative-filter-group android:allow="false">
<data android:pathPrefix="/auth" />
<data android:fragmentPrefix="faq" />
</uri-relative-filter-group>
</intent-filter>
Android 版プライバシー サンドボックス
Android 15 では、Android 広告サービスが拡張レベル 10 に引き上げられ、最新バージョンの Android 版プライバシー サンドボックスが組み込まれています。これは、モバイルアプリでユーザーのプライバシーを強化し、効果的なパーソナライズド広告体験を可能にする新しいテクノロジーを開発する取り組みの一環です。プライバシー サンドボックスのページには、Android 版プライバシー サンドボックスのデベロッパー プレビューとベータ版プログラムに関する詳細情報が記載されています。
ヘルスコネクト
Android 15 では、Android 14 拡張機能 10 が Android のヘルスコネクトに統合されています。これは、アプリで収集された健康やフィットネスのデータを管理および共有するための、安全で一元化されたプラットフォームです。このアップデートでは、フィットネスや栄養など、新しいデータ型のサポートが追加されています。
部分的画面共有
Android 15 では部分的な画面共有がサポートされているため、ユーザーはデバイスの画面全体ではなく、アプリ ウィンドウのみを共有または録画できます。この機能には Android 14 QPR2 で初めて有効になり、アプリで部分的な画面共有のエクスペリエンスをカスタマイズできる MediaProjection
コールバックが含まれています。Android 14(API レベル 34)以降をターゲットとするアプリでは、MediaProjection
キャプチャ セッションごとにユーザーの同意が必要になりました。
セキュリティ
Android 15 では、アプリのセキュリティを強化し、アプリのデータを保護できます。
エンドツーエンドの暗号化のための鍵管理
Android 15 で導入された E2eeContactKeysManager
は、暗号公開鍵の保存用に OS レベルの API を提供することで、Android アプリのエンドツーエンドの暗号化(E2EE)を容易にします。
E2eeContactKeysManager
は、プラットフォームの連絡先アプリと統合するように設計されています。これにより、ユーザーは連絡先の公開鍵を一元的に管理および検証できます。
fs-verity を使用してファイルを保護する
ユーザー エクスペリエンス
Android 15 では、アプリ デベロッパーとユーザーは、ニーズに合わせてデバイスをきめ細かく柔軟に設定できます。
サイレント モード ルールの改善
AutomaticZenRule
lets apps customize Attention
Management (Do Not Disturb) rules and decide when to activate or deactivate
them. Android 15 greatly enhances these rules with the goal of improving the
user experience. The following enhancements are included:
- Adding types to
AutomaticZenRule
, allowing the system to apply special treatment to some rules. - Adding an icon to
AutomaticZenRule
, helping to make the modes be more recognizable. - Adding a
triggerDescription
string toAutomaticZenRule
that describes the conditions on which the rule should become active for the user. - Added
ZenDeviceEffects
toAutomaticZenRule
, allowing rules to trigger things like grayscale display, night mode, or dimming the wallpaper.
多言語対応
Android 15 では、デバイスがさまざまな言語で使用されている場合のユーザー エクスペリエンスを補完する機能が追加されています。
文字間の両端揃え
Android 15 以降では、JUSTIFICATION_MODE_INTER_CHARACTER
を使用して、文字間隔を利用してテキストの両端揃えを行うことができます。単語間の両端揃えは Android 8.0(API レベル 26)で初めて導入されました。文字間両端揃えは、中国語や日本語などのセグメンテーションに空白文字を使用する言語でも同様の機能を提供します。