機能と API の概要

Android 15 では、デベロッパー向けに優れた新しい機能と API が導入されています。以降のセクションでは、関連する API の使用を開始する際に役立つこれらの機能の概要を説明します。

新しい API、変更された API、削除された API の詳細なリストについては、API 差分レポートをご覧ください。新しい API について詳しくは、Android API リファレンスをご覧ください。新しい API は、見やすくするためにハイライト表示されています。また、プラットフォームの変更がアプリに影響する領域については、Android 15 をターゲットとするアプリに影響する Android 15 の動作変更と、targetSdkVersion に関係なくすべてのアプリに影響する動作変更をご覧ください。

カメラとメディア

Android 15 には、カメラとメディアのエクスペリエンスを向上させるさまざまな機能が含まれています。また、クリエイターが Android でビジョンを具現化するのをサポートするツールやハードウェアにアクセスできます。

Android のメディアとカメラの最新機能とデベロッパー ソリューションについて詳しくは、Google I/O の最新の 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 では、サポート対象デバイスのカメラ ハードウェアとアルゴリズムをより詳細に制御するための新しい拡張機能が追加されています。

  • 高度なフラッシュの強さの調整: 画像の撮影中に SINGLE モードと TORCH モードの両方でフラッシュの強さを細かく制御できます。

HDR ヘッドルーム コントロール

Android 15 会选择适合底层设备功能和面板的位深的 HDR 余量。对于包含大量 SDR 内容的页面(例如显示单个 HDR 缩略图的即时通讯应用),此行为最终可能会对 SDR 内容的感知亮度产生不利影响。Android 15 允许您使用 setDesiredHdrHeadroom 控制 HDR 余量,以在 SDR 和 HDR 内容之间取得平衡。

左侧屏幕上 SDR 界面元素的亮度似乎比右侧屏幕的亮度更均匀,这模拟了混合 HDR 和 SDR 内容时可能出现的余量问题。通过调整 HDR 余量,您可以在 SDR 和 HDR 内容之间更好地平衡。

音量調整

Android 15 introduces support for the CTA-2075 loudness standard to help you avoid audio loudness inconsistencies and ensure users don't have to constantly adjust volume when switching between content. The system leverages known characteristics of the output devices (headphones and speaker) along with loudness metadata available in AAC audio content to intelligently adjust the audio loudness and dynamic range compression levels.

To enable this feature, you need to ensure loudness metadata is available in your AAC content and enable the platform feature in your app. For this, you instantiate a LoudnessCodecController object by calling its create factory method with the audio session ID from the associated AudioTrack; this automatically starts applying audio updates. You can pass an OnLoudnessCodecUpdateListener to modify or filter loudness parameters before they are applied on the 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 will also be updated to use the LoudnessCodecController APIs for a seamless app integration.

Virtual MIDI 2.0 デバイス

Android 13 では、Universal MIDI Packets(UMP)を使用して通信する USB を使用して MIDI 2.0 デバイスに接続するためのサポートが追加されました。Android 15 では、UMP のサポートが仮想 MIDI アプリに拡張されています。これにより、合成アプリは USB MIDI 2.0 デバイスの場合と同様に、シンセサイザー アプリを仮想 MIDI 2.0 デバイスとして制御できます。

AV1 ソフトウェア デコードの効率化

dav1d 徽标

dav1d(VideoLAN 中广受欢迎的 AV1 软件解码器)现已可用于在硬件中不支持 AV1 解码的 Android 设备。dav1d 的性能比旧版 AV1 软件解码器的性能高 3 倍,可让更多用户(包括一些中低层级的设备)播放高清 AV1 视频。

目前,您的应用需要通过调用 dav1d 名称 "c2.android.av1-dav1d.decoder" 来选择使用 dav1d。在后续更新中,dav1d 将成为默认的 AV1 软件解码器。这项支持已标准化,并向后移植到接收 Google Play 系统更新的 Android 11 设备。

デベロッパーの生産性とツール

生産性を向上させるための Google の取り組みのほとんどは、Android StudioJetpack ComposeAndroid Jetpack ライブラリなどのツールを中心としていますが、ユーザーがより簡単にビジョンを実現できる方法を常に模索しています。

OpenJDK 17 の更新

Android 15 continues the work of refreshing Android's core libraries to align with the features in the latest OpenJDK LTS releases.

The following key features and improvements are included:

These APIs are updated on over a billion devices running Android 12 (API level 31) and higher through Google Play System updates, so you can target the latest programming features.

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 latest updates to PDF rendering include features such as searching an embedded PDF file.

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 增加了设备端音频中的多语言识别功能,可在语言之间自动切换,但这可能会导致单词丢失,尤其是在语言切换时,两种话语之间的停顿较少时。Android 15 添加了额外的控件,可帮助应用根据其用例调整此切换。EXTRA_LANGUAGE_SWITCH_INITIAL_ACTIVE_DURATION_TIME_MILLIS 会将自动切换限制为仅在音频会话开始时进行,而 EXTRA_LANGUAGE_SWITCH_MATCH_SWITCHES 则会在指定次数的切换后停用语言切换。如果您希望自动检测到会话期间只讲一种语言,这些选项特别有用。

OpenType Variable Font API を改善

Android 15 improves the usability of the OpenType variable font. You can now create a FontFamily instance from a variable font without specifying weight axes with the buildVariableFamily API. The text renderer overrides the value of wght axis to match the displaying text.

Using the new API, this simplifies the code for creating a Typeface considerably:

Kotlin

val newTypeface = Typeface.CustomFallbackBuilder(
            FontFamily.Builder(
                Font.Builder(assets, "RobotoFlex.ttf").build())
                    .buildVariableFamily())
    .build()

Java

Typeface newTypeface = Typeface.CustomFallbackBuilder(
            new FontFamily.Builder(
                new Font.Builder(assets, "RobotoFlex.ttf").build())
                    .buildVariableFamily())
    .build();

Previously, to create the same Typeface, you would need much more code:

Kotlin

val oldTypeface = Typeface.CustomFallbackBuilder(
            FontFamily.Builder(
                Font.Builder(assets, "RobotoFlex.ttf")
                    .setFontVariationSettings("'wght' 400")
                    .setWeight(400)
                    .build())
                .addFont(
                    Font.Builder(assets, "RobotoFlex.ttf")
                        .setFontVariationSettings("'wght' 100")
                        .setWeight(100)
                        .build()
                )
                .addFont(
                    Font.Builder(assets, "RobotoFlex.ttf")
                        .setFontVariationSettings("'wght' 200")
                        .setWeight(200)
                        .build()
                )
                .addFont(
                    Font.Builder(assets, "RobotoFlex.ttf")
                        .setFontVariationSettings("'wght' 300")
                        .setWeight(300)
                        .build()
                )
                .addFont(
                    Font.Builder(assets, "RobotoFlex.ttf")
                        .setFontVariationSettings("'wght' 500")
                        .setWeight(500)
                        .build()
                )
                .addFont(
                    Font.Builder(assets, "RobotoFlex.ttf")
                        .setFontVariationSettings("'wght' 600")
                        .setWeight(600)
                        .build()
                )
                .addFont(
                    Font.Builder(assets, "RobotoFlex.ttf")
                        .setFontVariationSettings("'wght' 700")
                        .setWeight(700)
                        .build()
                )
                .addFont(
                    Font.Builder(assets, "RobotoFlex.ttf")
                        .setFontVariationSettings("'wght' 800")
                        .setWeight(800)
                        .build()
                )
                .addFont(
                    Font.Builder(assets, "RobotoFlex.ttf")
                        .setFontVariationSettings("'wght' 900")
                        .setWeight(900)
                        .build()
                ).build()
        ).build()

Java

Typeface oldTypeface = new Typeface.CustomFallbackBuilder(
    new FontFamily.Builder(
        new Font.Builder(assets, "RobotoFlex.ttf")
            .setFontVariationSettings("'wght' 400")
            .setWeight(400)
            .build()
    )
    .addFont(
        new Font.Builder(assets, "RobotoFlex.ttf")
            .setFontVariationSettings("'wght' 100")
            .setWeight(100)
            .build()
    )
    .addFont(
        new Font.Builder(assets, "RobotoFlex.ttf")
            .setFontVariationSettings("'wght' 200")
            .setWeight(200)
            .build()
    )
    .addFont(
        new Font.Builder(assets, "RobotoFlex.ttf")
            .setFontVariationSettings("'wght' 300")
            .setWeight(300)
            .build()
    )
    .addFont(
        new Font.Builder(assets, "RobotoFlex.ttf")
            .setFontVariationSettings("'wght' 500")
            .setWeight(500)
            .build()
    )
    .addFont(
        new Font.Builder(assets, "RobotoFlex.ttf")
            .setFontVariationSettings("'wght' 600")
            .setWeight(600)
            .build()
    )
    .addFont(
        new Font.Builder(assets, "RobotoFlex.ttf")
            .setFontVariationSettings("'wght' 700")
            .setWeight(700)
            .build()
    )
    .addFont(
        new Font.Builder(assets, "RobotoFlex.ttf")
            .setFontVariationSettings("'wght' 800")
            .setWeight(800)
            .build()
    )
    .addFont(
        new Font.Builder(assets, "RobotoFlex.ttf")
            .setFontVariationSettings("'wght' 900")
            .setWeight(900)
            .build()
    )
    .build()
).build();

Here's an example of how a Typeface created with both the old and new APIs renders:

An example of how Typeface rendering differs using new and old
APIs

In this example, the Typeface created with the old API doesn't have the capability to create accurate font weights for the 350, 450, 550 and 650 Font instances, so the renderer falls back to the closest weight. So in this case, 300 is rendered instead of 350, 400 is rendered instead of 450, and so on. By contrast, the Typeface created with the new APIs dynamically creates a Font instance for a given weight, so accurate weights are rendered for 350, 450, 550, and 650 as well.

きめの細かい改行コントロール

Starting in Android 15, a TextView and the underlying line breaker can preserve the given portion of text in the same line to improve readability. You can take advantage of this line break customization by using the <nobreak> tag in string resources or createNoBreakSpan. Similarly, you can preserve words from hyphenation by using the <nohyphen> tag or createNoHyphenationSpan.

For example, the following string resource doesn't include a line break, and renders with the text "Pixel 8 Pro." breaking in an undesirable place:

<resources>
    <string name="pixel8pro">The power and brains behind Pixel 8 Pro.</string>
</resources>

In contrast, this string resource includes the <nobreak> tag, which wraps the phrase "Pixel 8 Pro." and prevents line breaks:

<resources>
    <string name="pixel8pro">The power and brains behind <nobreak>Pixel 8 Pro.</nobreak></string>
</resources>

The difference in how these strings are rendered is shown in the following images:

Layout for a line of text where the phrase "Pixel 8 Pro." isn't wrapped using a <nobreak> tag.
Layout for the same line of text where the phrase "Pixel 8 Pro." is wrapped using a <nobreak> tag.

アプリのアーカイブ

Android and Google Play announced support for app archiving last year, allowing users to free up space by partially removing infrequently used apps from the device that were published using Android App Bundle on Google Play. Android 15 now includes OS level support for app archiving and unarchiving, making it easier for all app stores to implement it.

Apps with the REQUEST_DELETE_PACKAGES permission can call the PackageInstaller requestArchive method to request archiving an installed app package, which removes the APK and any cached files, but persists user data. Archived apps are returned as displayable apps through the LauncherApps APIs; users will see a UI treatment to highlight that those apps are archived. If a user taps on an archived app, the responsible installer will get a request to unarchive it, and the restoration process can be monitored by the ACTION_PACKAGE_ADDED broadcast.

グラフィック

Android 15 では、ANGLE や Canvas グラフィック システムの追加など、最新のグラフィック改善が行われています。

Android の GPU アクセスのモダナイゼーション

Vulkan logo

Android hardware has evolved quite a bit from the early days where the core OS would run on a single CPU and GPUs were accessed using APIs based on fixed-function pipelines. The Vulkan® graphics API has been available in the NDK since Android 7.0 (API level 24) with a lower-level abstraction that better reflects modern GPU hardware, scales better to support multiple CPU cores, and offers reduced CPU driver overhead — leading to improved app performance. Vulkan is supported by all modern game engines.

Vulkan is Android's preferred interface to the GPU. Therefore, Android 15 includes ANGLE as an optional layer for running OpenGL® ES on top of Vulkan. Moving to ANGLE will standardize the Android OpenGL implementation for improved compatibility, and, in some cases, improved performance. You can test out your OpenGL ES app stability and performance with ANGLE by enabling the developer option in Settings -> System -> Developer Options -> Experimental: Enable ANGLE on Android 15.

The Android ANGLE on Vulkan roadmap

Roadmap of upcoming changes to the Android GPU APIs.

As part of streamlining our GPU stack, going forward we will be shipping ANGLE as the GL system driver on more new devices, with the future expectation that OpenGL/ES will be only available through ANGLE. That being said, we plan to continue support for OpenGL ES on all devices.

Recommended next steps

Use the developer options to select the ANGLE driver for OpenGL ES and test your app. For new projects, we strongly encourage using Vulkan for C/C++.

Canvas の改善点

Android 15 继续对 Android 的 Canvas 图形系统进行现代化改造,并增添了新功能:

  • Matrix44 提供了一个用于转换坐标的 4x4 矩阵,当您想要处理 3D 画布时,应使用此矩阵。
  • clipShader 将当前裁剪与指定着色器相交,而 clipOutShader 会将裁剪设置为当前裁剪和着色器的差异,其中各自将着色器视为 Alpha 蒙版。这有助于高效绘制复杂形状。

パフォーマンスとバッテリー

Android は、引き続きアプリのパフォーマンスと品質の改善に力を注いでいます。Android 15 では、アプリ内のタスクの実行の効率化、アプリのパフォーマンスの最適化、アプリに関する分析情報の収集に役立つ新しい API が導入されています。

バッテリー効率の高いおすすめの方法、ネットワークと電力使用量のデバッグ、および Android 15 と Android の最近のバージョンにおけるバックグラウンド処理のバッテリー効率を向上させる方法について詳しくは、Google I/O の Android でのバックグラウンド処理のバッテリー効率を改善するをご覧ください。

ApplicationStartInfo API

以前のバージョンの Android では、アプリの起動が少し謎でした。アプリ内で、コールド状態、ウォーム状態、ホット状態のうちどれで開始されたのかを判断するのが困難でした。また、プロセスのフォーク、onCreate の呼び出し、最初のフレームの描画など、さまざまなリリース フェーズにアプリが費やした時間を把握するのも困難でした。Application クラスがインスタンス化された時点では、アプリがブロードキャスト、コンテンツ プロバイダ、ジョブ、バックアップ、起動完了、アラーム、Activity のどれから開始されたかを知る方法がありませんでした。

Android 15 の ApplicationStartInfo API は、これらすべてを提供します。独自のタイムスタンプをフローに追加して、タイミング データを 1 か所に収集することもできます。ApplicationStartInfo を使用すると、指標を収集するだけでなく、アプリの起動を直接最適化することもできます。たとえば、ブロードキャストによってアプリが起動したときに、Application クラス内で UI 関連ライブラリのインスタンス化のコストがかからなくなります。

アプリのサイズに関する詳細情報

自 Android 8.0(API 级别 26)起,Android 就一直包含 StorageStats.getAppBytes API,该 API 将应用的安装大小汇总为一个字节,这些字节是 APK 大小、从 APK 中提取的文件的大小以及设备上生成的文件(例如预先 (AOT) 编译代码)的总和。就应用的存储空间使用情况而言,此数字并不富有见解。

Android 15 增加了 StorageStats.getAppBytesByDataType([type]) API,可让您深入了解应用如何使用所有空间,包括 APK 文件拆分、AOT 和加速相关代码、dex 元数据、库和引导式配置文件。

アプリ管理のプロファイリング

Android 15 には、アプリ内からプロファイリング情報を収集できる新しい ProfilingManager クラスが含まれています。プロファイリング リクエストの作成を簡素化する Android Jetpack API でこれをラップする予定ですが、コア API ではヒープダンプ、ヒープ プロファイル、スタック サンプリングなどの収集が可能になります。出力ファイルを識別するタグで指定されたコールバックをアプリに提供します。出力ファイルは、アプリのファイル ディレクトリに配信されます。パフォーマンスへの影響を最小限に抑えるために、API はレート制限を行います。

SQLite データベースの改善

Android 15 introduces new SQLite APIs that expose advanced features from the underlying SQLite engine that target specific performance issues that can manifest in apps.

Developers should consult best practices for SQLite performance to get the most out of their SQLite database, especially when working with large databases or when running latency-sensitive queries.

  • Read-only deferred transactions: when issuing transactions that are read-only (don't include write statements), use beginTransactionReadOnly() and beginTransactionWithListenerReadOnly(SQLiteTransactionListener) to issue read-only DEFERRED transactions. Such transactions can run concurrently with each other, and if the database is in WAL mode, they can run concurrently with IMMEDIATE or EXCLUSIVE transactions.
  • Row counts and IDs: new APIs were added to retrieve the count of changed rows or the last inserted row ID without issuing an additional query. getLastChangedRowCount() returns the number of rows that were inserted, updated, or deleted by the most recent SQL statement within the current transaction, while getTotalChangedRowCount() returns the count on the current connection. getLastInsertRowId() returns the rowid of the last row to be inserted on the current connection.
  • Raw statements: issue a raw SQlite statement, bypassing convenience wrappers and any additional processing overhead that they may incur.

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 构建了通过 UriRelativeFilterGroup 支持更精确的 Intent 解析,其中包含一组 UriRelativeFilter 对象,这些对象构成了一组必须满足的 Intent 匹配规则,其中包括网址查询参数、网址片段以及屏蔽或排除规则。

您可以使用新的 <uri-relative-filter-group> 标记在 AndroidManifest XML 文件中定义这些规则,也可以选择包含 android:allow 标记。这些标记可以包含使用现有数据标记属性以及新的 android:queryandroid:fragment 属性的 <data> 标记。

下面是 AndroidManifest 语法的示例:

<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>

プライベート スペース

The private space can be unlocked and locked to show or hide sensitive apps on a device.

Private space lets users create a separate space on their device where they can keep sensitive apps away from prying eyes, under an additional layer of authentication. The private space uses a separate user profile. The user can choose to use the device lock or a separate lock factor for the private space.

Apps in the private space show up in a separate container in the launcher, and are hidden from the recents view, notifications, settings, and from other apps when the private space is locked. User-generated and downloaded content (such as media or files) and accounts are separated between the private space and the main space. The system sharesheet and the photo picker can be used to give apps access to content across spaces when the private space is unlocked.

Users can't move existing apps and their data into the private space. Instead, users select an install option in the private space to install an app using whichever app store they prefer. Apps in the private space are installed as separate copies from any apps in the main space (new copies of the same app).

When a user locks the private space, the profile is stopped. While the profile is stopped, apps in the private space are no longer active and can't perform foreground or background activities, including showing notifications.

We recommend that you test your app with private space to make sure your app works as expected, especially if your app falls into one of the following categories:

「選択した写真へのアクセス」について最新のユーザー選択をクエリする

It is now possible for apps to highlight only the most recently selected photos and videos when partial access to media permissions is granted. This feature can improve the user experience for apps that frequently request access to photos and videos. To use this feature in your app, enable the QUERY_ARG_LATEST_SELECTION_ONLY argument when querying MediaStore through ContentResolver.

Kotlin

val externalContentUri = MediaStore.Files.getContentUri("external")

val mediaColumns = arrayOf(
   FileColumns._ID,
   FileColumns.DISPLAY_NAME,
   FileColumns.MIME_TYPE,
)

val queryArgs = bundleOf(
   // Return only items from the last selection (selected photos access)
   QUERY_ARG_LATEST_SELECTION_ONLY to true,
   // Sort returned items chronologically based on when they were added to the device's storage
   QUERY_ARG_SQL_SORT_ORDER to "${FileColumns.DATE_ADDED} DESC",
   QUERY_ARG_SQL_SELECTION to "${FileColumns.MEDIA_TYPE} = ? OR ${FileColumns.MEDIA_TYPE} = ?",
   QUERY_ARG_SQL_SELECTION_ARGS to arrayOf(
       FileColumns.MEDIA_TYPE_IMAGE.toString(),
       FileColumns.MEDIA_TYPE_VIDEO.toString()
   )
)

Java

Uri externalContentUri = MediaStore.Files.getContentUri("external");

String[] mediaColumns = {
    FileColumns._ID,
    FileColumns.DISPLAY_NAME,
    FileColumns.MIME_TYPE
};

Bundle queryArgs = new Bundle();
queryArgs.putBoolean(MediaStore.QUERY_ARG_LATEST_SELECTION_ONLY, true);
queryArgs.putString(MediaStore.QUERY_ARG_SQL_SORT_ORDER, FileColumns.DATE_ADDED + " DESC");
queryArgs.putString(MediaStore.QUERY_ARG_SQL_SELECTION, FileColumns.MEDIA_TYPE + " = ? OR " + FileColumns.MEDIA_TYPE + " = ?");
queryArgs.putStringArray(MediaStore.QUERY_ARG_SQL_SELECTION_ARGS, new String[] {
    String.valueOf(FileColumns.MEDIA_TYPE_IMAGE),
    String.valueOf(FileColumns.MEDIA_TYPE_VIDEO)
});

Android 版プライバシー サンドボックス

Android 15 には、最新バージョンの Android 版プライバシー サンドボックスを組み込んだ最新の Android 広告サービス拡張機能が搭載されています。この追加は、ユーザーのプライバシーを向上させ、モバイルアプリで効果的なパーソナライズド広告体験を可能にする新しいテクノロジーを開発する取り組みの一環です。プライバシー サンドボックスのページには、Android 版プライバシー サンドボックス デベロッパー プレビューとベータ版プログラムに関する詳細情報が記載されています。

ヘルスコネクト

Android 15 には、Android のヘルスコネクトに関する最新の拡張機能が統合されています。これは、アプリで収集された健康とフィットネスに関するデータを管理および共有するための、安全で一元化されたプラットフォームです。このアップデートにより、フィットネス栄養、皮膚温、トレーニング プランなど、新しいデータ型のサポートが追加されました。

皮膚温のトラッキングを使用すると、ウェアラブルなどのトラッキング デバイスからより正確な温度データを保存し、共有できます。

トレーニング プランは、ユーザーがフィットネスの目標を達成できるように構造化されたワークアウト プランです。トレーニング プランは、さまざまな完了目標やパフォーマンス目標をサポートしています。

Android のヘルスコネクトの最新アップデートについては、Google I/O の講演 Android Health で適応性の高いエクスペリエンスを構築するをご覧ください。

部分的画面共有

Android 15 では部分的な画面共有がサポートされているため、ユーザーはデバイスの画面全体ではなく、アプリ ウィンドウのみを共有または録画できます。この機能には Android 14 QPR2 で初めて有効になり、アプリで部分的な画面共有のエクスペリエンスをカスタマイズできる MediaProjection コールバックが含まれています。Android 14(API レベル 34)以降をターゲットとするアプリでは、MediaProjection キャプチャ セッションごとにユーザーの同意が必要になりました。

ユーザー エクスペリエンスとシステム UI

Android 15 では、アプリ デベロッパーとユーザーは、ニーズに合わせてデバイスをより細かく柔軟に設定できます。

Android 15 の最新の改善点を使用してアプリのユーザー エクスペリエンスを改善する方法について詳しくは、Google I/O の Android アプリのユーザー エクスペリエンスを改善するをご覧ください。

Generated Previews API によるリッチなウィジェット プレビュー

在 Android 15 之前,提供 widget 选择器预览的唯一方法是指定静态图片或布局资源。这些预览通常会与实际 widget 放置在主屏幕上时的外观有明显差异。此外,无法使用 Jetpack Glance 创建静态资源,因此 Glance 开发者必须对其 widget 进行屏幕截图或创建 XML 布局,才能具有 widget 预览。

Android 15 增加了对生成的预览的支持。这意味着,应用 widget 提供程序可以生成 RemoteViews(而不是静态资源)来用作选择器预览。

应用可以为 widget 选择器提供远程视图,以便更新选择器中的内容,使其更能代表用户将看到的内容。

推送 API

应用可以通过推送 API 提供生成的预览。应用可以在其生命周期的任何时间点提供预览,而不会收到主机发送的关于提供预览的明确请求。预览会保留在 AppWidgetService 中,并且主机可以按需请求预览。以下示例会加载 XML widget 布局资源,并将其设置为预览:

AppWidgetManager.getInstance(appContext).setWidgetPreview(
   ComponentName(
       appContext,
       SociaLiteAppWidgetReceiver::class.java
   ),
   AppWidgetProviderInfo.WIDGET_CATEGORY_HOME_SCREEN,
   RemoteViews("com.example", R.layout.widget_preview)
)

预期的流程为:

  1. 任何时候,widget 提供程序都会调用 setWidgetPreview。提供的预览与其他提供程序信息一起保留在 AppWidgetService 中。
  2. setWidgetPreview 通过 AppWidgetHost.onProvidersChanged 回调将预览更新后通知主机。作为响应,widget 主机会重新加载其所有提供程序信息。
  3. 显示 widget 预览时,托管应用会检查 AppWidgetProviderInfo.generatedPreviewCategories,如果所选类别可用,则调用 AppWidgetManager.getWidgetPreview 以返回此提供程序的已保存预览。

何时调用 setWidgetPreview

由于没有用于提供预览的回调,因此应用在运行时可以选择随时发送预览。预览的更新频率取决于 widget 的用例。

以下列表介绍了预览用例的两大主要类别:

  • 在 widget 预览中显示真实数据(例如个性化或最新信息)的提供程序。用户登录应用或在应用中完成初始配置后,这些提供程序就可以设置预览。之后,他们可以设置一个定期任务,按所选频率更新预览。此类 widget 的示例包括照片、日历、天气或新闻 widget。
  • 在预览中显示静态信息的提供程序或不显示任何数据的快速操作 widget。这些提供程序可在应用首次启动时设置一次预览。此类微件的示例包括云端硬盘“快速操作”微件或 Chrome 快捷方式微件。

某些提供程序可能会在基座接入模式选择器上显示静态预览,但在主屏幕选择器上显示真实信息。这些提供程序应遵循针对这两种用例的指南来设置预览。

ピクチャー イン ピクチャー

Android 15 引入了对画中画 (PiP) 功能的新变更,可确保在进入画中画模式时能够更顺畅地过渡。这对于将界面元素叠加在其主界面之上的应用(将进入画中画模式)非常有用。

开发者使用 onPictureInPictureModeChanged 回调来定义用于切换叠加界面元素的可见性的逻辑。此回调会在画中画进入或退出动画播放完毕时触发。从 Android 15 开始,PictureInPictureUiState 类包含一个新状态。

借助这种新的界面状态,以 Android 15 为目标平台的应用会在画中画动画开始时立即观察到使用 isTransitioningToPip() 调用的 Activity#onPictureInPictureUiStateChanged 回调。在应用处于画中画模式时,有许多界面元素与应用无关,例如,包含建议、即将播出的视频、评分和标题等信息的视图或布局。当应用进入画中画模式时,使用 onPictureInPictureUiStateChanged 回调隐藏这些界面元素。当应用从画中画窗口进入全屏模式时,可以使用 onPictureInPictureModeChanged 回调来取消隐藏这些元素,如以下示例所示:

override fun onPictureInPictureUiStateChanged(pipState: PictureInPictureUiState) {
        if (pipState.isTransitioningToPip()) {
          // Hide UI elements
        }
    }
override fun onPictureInPictureModeChanged(isInPictureInPictureMode: Boolean) {
        if (isInPictureInPictureMode) {
          // Unhide UI elements
        }
    }

这种可快速切换不相关界面元素(适用于画中画窗口)的可见性切换有助于确保画中画进入动画更加流畅且无闪烁。

サイレント モード ルールの改善

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 to AutomaticZenRule that describes the conditions on which the rule should become active for the user.
  • Added ZenDeviceEffects to AutomaticZenRule, allowing rules to trigger things like grayscale display, night mode, or dimming the wallpaper.

通知チャンネルの VibrationEffect を設定する

Android 15 では、NotificationChannel.setVibrationEffect を使用してチャンネルごとに着信通知にリッチ バイブレーションを設定できるため、ユーザーはデバイスを見ることなく、さまざまな種類の通知を区別できます。

大画面とフォーム ファクタ

Android 15 では、大画面、フリップ式デバイス、折りたたみ式デバイスなど、Android のフォーム ファクタを最大限に活用するためのサポートがアプリで提供されています。

大画面でのマルチタスクの改善

Android 15 gives users better ways to multitask on large screen devices. For example, users can save their favorite split-screen app combinations for quick access and pin the taskbar on screen to quickly switch between apps. This means that making sure your app is adaptive is more important than ever.

Google I/O has sessions on Building adaptive Android apps and Building UI with the Material 3 adaptive library that can help, and our documentation has more to help you Design for large screens.

カバー画面のサポート

アプリは、サポートされているフリップ式デバイスの小さなカバー画面に Application または Activity を表示できるように、Android 15 で使用されるプロパティを宣言できます。これらの画面は小さすぎるため、Android アプリの実行可能なターゲットとして見なされませんが、アプリでサポートをオプトインすることで、より多くの場所でアプリを利用できるようになります。

接続

Android 15 ではプラットフォームが更新され、アプリは最新の通信技術とワイヤレス技術にアクセスできます。

衛星のサポート

Android 15 继续扩展对卫星连接的平台支持,并添加了一些界面元素,以确保在卫星连接环境中提供一致的用户体验。

应用可以使用 ServiceState.isUsingNonTerrestrialNetwork() 检测设备何时连接到卫星,从而更好地了解为什么全网络服务不可用。此外,Android 15 支持短信和彩信应用以及预加载的 RCS 应用,以便使用卫星连接收发信息。

设备连接到卫星时显示通知。

NFC の操作性が向上

Android 15 致力于打造更顺畅、更可靠的感应式付款体验,同时继续支持 Android 强大的 NFC 应用生态系统。在受支持的设备上,应用可以请求 NfcAdapter 进入观察模式。在该模式下,设备会监听 NFC 读取器但不会响应 NFC 读取器,从而将应用的 NFC 服务 PollingFrame 对象发送给系统进行处理。PollingFrame 对象可用于在与 NFC 读取器首次通信之前进行身份验证,以便在许多情况下实现一键交易。

此外,应用现在可以在受支持的设备上注册过滤器,以便接收轮询循环 activity 的通知,从而与多个 NFC 感知应用顺畅运行。

ウォレットの役割

Android 15 では、ユーザーが使用するウォレット アプリとより緊密に統合できるウォレットの新しいロールが導入されています。このロールは、NFC のデフォルトの非接触型決済の設定に代わるものです。ウォレットのロールを保持するユーザーは、[設定] > [アプリ] > [デフォルト アプリ] に移動して管理できます。

ウォレットのロールは、支払いカテゴリに登録されている AID に NFC タップをルーティングする場合に使用します。同じ AID に登録されている別のアプリがフォアグラウンドで実行されている場合を除き、タップは常にウォレットのロール所有者に移動します。

このロールは、ウォレットのクイックアクセス タイルが有効な場合にどこに配置するかを決定するためにも使用されます。ロールが「なし」に設定されている場合、QuickAccess タイルは使用できず、支払いカテゴリの NFC タップはフォアグラウンド アプリにのみ配信されます。

セキュリティ

Android 15 では、アプリのセキュリティの強化、アプリのデータの保護、ユーザーによるデータの透明性と管理が可能になります。ユーザーの安全保護対策を改善し、新たな脅威からアプリを保護するために Google が行っている取り組みについて詳しくは、Google I/O の Android でのユーザー セキュリティの保護に関する講演をご覧ください。

認証情報マネージャーを自動入力と統合する

Starting with Android 15, developers can link specific views like username or password fields with Credential Manager requests, making it easier to provide a tailored user experience during the sign-in process. When the user focuses on one of these views, a corresponding request is sent to Credential Manager. The resulting credentials are aggregated across providers and displayed in autofill fallback UIs, such as inline suggestions or drop-down suggestions. The Jetpack androidx.credentials library is the preferred endpoint for developers to use and will soon be available to further enhance this feature in Android 15 and higher.

生体認証プロンプトにシングルタップによる登録とログインを統合

Credential Manager integrates biometric prompts into the credential creation and sign-in processes, eliminating the need for providers to manage biometric prompts. As a result, credential providers only need to focus on the results of the create and get flows, augmented with the biometric flow result. This simplified process creates a more efficient and streamlined credential creation and retrieval process.

エンドツーエンドの暗号化のための鍵管理

Android 15 で導入された E2eeContactKeysManager は、暗号公開鍵の保存用に OS レベルの API を提供することで、Android アプリのエンドツーエンドの暗号化(E2EE)を容易にします。

E2eeContactKeysManager は、プラットフォームの連絡先アプリと統合するように設計されています。これにより、ユーザーは連絡先の公開鍵を一元的に管理および検証できます。

コンテンツ URI に対する権限チェック

Android 15 引入了一组可对内容 URI 执行权限检查的新 API:

ユーザー補助

Android 15 では、ユーザーのユーザー補助機能を向上させる機能が追加されています。

点字の改善

Android 15 では、USB とセキュアな Bluetooth の両方で HID 標準を使用する点字ディスプレイを TalkBack でサポートできるようになりました。

マウスやキーボードで使用されている標準規格と同様に、Android は今後、より幅広い種類の点字ディスプレイをサポートするようになります。

多言語対応

Android 15 では、デバイスをさまざまな言語で使用する場合のユーザー エクスペリエンスに役立つ機能が追加されています。

CJK 可変フォント

Android 15 以降、中国語、日本語、韓国語(CJK)言語のフォント ファイル NotoSansCJK が可変フォントになりました。可変フォントを使用すると、CJK 言語でのクリエイティブ タイポグラフィの可能性が広がります。デザイナーは、より幅広いスタイルを検討し、以前は実現が困難または不可能だった、視覚に訴えるレイアウトを作成できます。

中国語、日本語、韓国語(CJK)言語の可変フォントが、さまざまなフォント幅で表示される場合。

文字間の両端揃え

Starting with Android 15, text can be justified utilizing letter spacing by using JUSTIFICATION_MODE_INTER_CHARACTER. Inter-word justification was first introduced in Android 8.0 (API level 26), and inter-character justification provides similar capabilities for languages that use the whitespace character for segmentation, such as Chinese, Japanese, and others.

Layout for Japanese text using JUSTIFICATION_MODE_NONE.
Layout for English text using JUSTIFICATION_MODE_NONE.


Layout for Japanese text using JUSTIFICATION_MODE_INTER_WORD.
Layout for English text using JUSTIFICATION_MODE_INTER_WORD.


Layout for Japanese text using the new JUSTIFICATION_MODE_INTER_CHARACTER.
Layout for English text using the new JUSTIFICATION_MODE_INTER_CHARACTER.

改行の自動設定

Android 从 Android 13(API 级别 33)开始针对日语和韩语支持基于短语的换行符。不过,虽然基于短语的换行符可以提高短行文本的可读性,但不适用于较长的文本。在 Android 15 中,应用现在可以使用 LINE_BREAK_WORD_STYLE_AUTO 选项为短文本行应用基于短语的换行符。此选项用于选择最适合该文本的文字样式选项。

对于简短的文本行,使用基于短语的换行符,其功能与 LINE_BREAK_WORD_STYLE_PHRASE 相同,如下图所示:

对于简短的文本行,LINE_BREAK_WORD_STYLE_AUTO 会采用基于短语的换行符,以提高文本的可读性。 这与应用 LINE_BREAK_WORD_STYLE_PHRASE 相同。

对于较长的文本,LINE_BREAK_WORD_STYLE_AUTO 使用不换行的字词样式,其功能与 LINE_BREAK_WORD_STYLE_NONE 相同,如下图所示:

对于较长的文本,LINE_BREAK_WORD_STYLE_AUTO 不会应用换行字词样式,以提高文本的可读性。 这与应用 LINE_BREAK_WORD_STYLE_NONE 相同。

新しい日本語の変態文字フォント

Android 15 では、古い日本語のひらがな(変名)の新しいフォント ファイルがデフォルトでバンドルされています。変身長のユニークな形は、アートワークやデザインに独特の魅力をプラスし、古代日本の文書を正確に伝え、理解するのにも役立ちます。

日本語の変態フォントの文字とテキスト スタイル。

VideoLAN cone Copyright (c) 1996-2010 VideoLAN. このロゴまたは修正版は、VideoLAN プロジェクト、または VideoLAN チームが開発したプロダクトに言及するために、誰でも使用または変更することができますが、プロジェクトによる承認を示すものではありません。

Vulkan および Vulkan ロゴは、Khronos Group Inc.の登録商標です。

OpenGL は Hewlett Packard Enterprise の登録商標で、OpenGL ES ロゴは Khronos の許可を得て使用しています。