Özelliklere ve API'lere Genel Bakış

Android 15, geliştiriciler için harika özellikler ve API'ler sunuyor. Aşağıdaki bölümlerde, ilgili API'leri kullanmaya başlamanıza yardımcı olmak için bu özellikler özetlenmiştir.

Eklenen, değiştirilen ve kaldırılan API'lerin ayrıntılı listesi için API farkı raporunu inceleyin. Eklenen API'lerle ilgili ayrıntılar için Android API referansını ziyaret edin. Android 15'te API düzeyi 35'te eklenen API'leri inceleyin. Platform değişikliklerinin uygulamalarınızı etkileyebileceği alanlar hakkında bilgi edinmek için Android 15'te Android 15'i hedefleyen uygulamalarda ve tüm uygulamalarda davranış değişikliklerini inceleyin.

Kamera ve medya içerikleri

Android 15, kamera ve medya deneyimini iyileştiren, içerik üreticilerin Android'de vizyonlarını hayata geçirmelerini desteklemek için araçlara ve donanımlara erişmelerini sağlayan çeşitli özellikler içerir.

Android'deki medya ve kamera için en yeni özellikler ve geliştirici çözümleri hakkında daha fazla bilgi edinmek istiyorsanız Google I/O'daki Building modern Android media and camera experiences (Modern Android medya ve kamera deneyimleri oluşturma) başlıklı konuşmayı izleyin.

Loş ışık iyileştirme

Android 15 引入了弱光增强功能,这是一种自动曝光模式,适用于 Camera 2夜间模式相机扩展。“弱光增强”功能可在光线昏暗的环境下调整预览画面的曝光度。这与夜间模式相机扩展程序创建静态图片的方式不同,因为夜间模式会将一系列照片组合起来,以创建一张经过增强的单张图片。虽然夜间模式非常适合拍摄静态图片,但无法创建连续的帧流,而“低光增强”功能可以。因此,弱光增强功能可启用相机功能,例如:

  • 提供增强型图片预览,以便用户更好地取景拍摄低光照片
  • 在光线不足的情况下扫描二维码

如果您启用“弱光增强”功能,该功能会在光线较弱时自动开启,在光线较强时关闭。

应用可以在光线昏暗的环境下录制预览画面,以保存经过亮度提升的视频。

如需了解详情,请参阅弱光增强

Uygulama içi kamera kontrolleri

Android 15 adds an extension for more control over the camera hardware and its algorithms on supported devices:

  • Advanced flash strength adjustments enabling precise control of flash intensity in both SINGLE and TORCH modes while capturing images.

HDR headroom kontrolü

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.

The brightness of SDR UI elements on the left screen appears to be more uniform than the brightness on the right screen, which simulates possible headroom issues when HDR and SDR content are mixed. By adjusting the HDR headroom, you can achieve a better balance between the SDR and HDR content.

Ses yüksekliği kontrolü

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.

Sanal MIDI 2.0 cihazları

Android 13 添加了对使用 USB 连接 MIDI 2.0 设备的支持,这些设备使用通用 MIDI 数据包 (UMP) 进行通信。Android 15 将 UMP 支持扩展到了虚拟 MIDI 应用,使作曲应用能够像使用 USB MIDI 2.0 设备一样,将虚拟 MIDI 2.0 设备用作控制合成器应用的设备。

Daha verimli AV1 yazılım kod çözme

dav1d logo

dav1d, the popular AV1 software decoder from VideoLAN is available for Android devices that don't support AV1 decode in hardware. dav1d is up to 3x more performant than the legacy AV1 software decoder, enabling HD AV1 playback for more users, including some low and mid tier devices.

Your app needs to opt-in to using dav1d by invoking it by name "c2.android.av1-dav1d.decoder". dav1d will be made the default AV1 software decoder in a subsequent update. This support is standardized and backported to Android 11 devices that receive Google Play system updates.

Geliştirici üretkenliği ve araçları

Üretkenliğinizi artırmaya yönelik çalışmalarımızın çoğu Android Studio, Jetpack Compose ve Android Jetpack kitaplıkları gibi araçlara odaklanırken platformda vizyonunuzu daha kolay gerçekleştirmenize yardımcı olacak yollar aramaya devam ediyoruz.

OpenJDK 17 güncellemeleri

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 iyileştirmeleri

Android 15 对 PdfRenderer API 进行了重大改进。应用可以整合呈现等高级功能 受密码保护的文件、注释、表单编辑searching,而 selection 则包含副本。支持线性化 PDF 优化,此功能可加快本地 PDF 查看速度并减少资源使用量。Jetpack PDF 库使用这些 API 来简化 PDF 的添加 查看功能。

<ph type="x-smartling-placeholder">
</ph>
PDF 渲染的最新更新包括 搜索嵌入式 PDF 文件中的内容。

PdfRenderer 已移至一个可使用 Google Play 系统更新独立于平台版本,并且我们支持 将这些变更还原到 Android 11(API 级别 30),方法是创建兼容的 Android 15 之前版本的 API Surface,称为 PdfRendererPreV

Otomatik dil geçişiyle ilgili iyileştirmeler

Android 14 在音频中添加了设备端多语言识别功能,并支持在语言之间自动切换,但这可能会导致丢失字词,尤其是当两次语音之间语言切换的间隔时间较短时。Android 15 添加了其他控件,以帮助应用根据其用例调整此切换。EXTRA_LANGUAGE_SWITCH_INITIAL_ACTIVE_DURATION_TIME_MILLIS 会将自动切换限制在音频会话开始时,而 EXTRA_LANGUAGE_SWITCH_MATCH_SWITCHES 会在发生指定次数的切换后停用语言切换。如果您预计会话期间只会使用一种语言,并且该语言应被自动检测到,这些选项会特别有用。

Geliştirilmiş OpenType Variable Font API

Android 15 提高了 OpenType 可变字体的易用性。您可以创建 来自可变字体的 FontFamily 实例,而不指定粗细轴 使用 buildVariableFamily API。文本渲染程序会替换 wght 轴的值,以匹配显示的文本。

使用该 API 可以大大简化创建 Typeface 的代码:

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();

以前,如需创建相同的 Typeface,您需要更多代码:

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();

以下示例展示了同时使用旧版和新版 API 创建的 Typeface 的呈现方式:

使用新旧 API 渲染字体时出现差异的示例

在此示例中,使用旧 API 创建的 Typeface 不包含 为 350、450、550 和 650 创建准确的字体粗细 Font 实例,因此渲染程序会回退到最接近的权重。在 在此示例中,系统会渲染 300 而不是 350,渲染 400 而不是 450, 依此类推。相比之下,使用新 API 创建的 Typeface 会为给定重量动态创建 Font 实例,因此系统也会为 350、450、550 和 650 呈现准确的重量。

Ayrıntılı satır sonu kontrolleri

Android 15'ten itibaren, TextView ve temel satır ayırıcı, okunabilirliği artırmak için metnin belirli bir bölümünü aynı satırda koruyabilir. Dize kaynaklarında <nobreak> etiketini veya createNoBreakSpan kullanarak bu satır sonu özelleştirmesinden yararlanabilirsiniz. Benzer şekilde, <nohyphen> etiketini veya createNoHyphenationSpan kullanarak kelimeleri kısaltmalardan koruyabilirsiniz.

Örneğin, aşağıdaki dize kaynağı satır sonu içermez ve "Pixel 8 Pro" metninin istenmeyen bir yerde kesildiği şekilde oluşturulur:

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

Buna karşılık bu dize kaynağı, "Pixel 8 Pro" ifadesini sarmalayan ve satır aralarını önleyen <nobreak> etiketini içerir:

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

Bu dizelerin oluşturulma biçimleri arasındaki fark aşağıdaki resimlerde gösterilmektedir:

"Pixel 8 Pro." ifadesinin <nobreak> etiketi kullanılarak sarmalandığı bir metin satırı için düzen.
"Pixel 8 Pro." ifadesinin <nobreak> etiketi kullanılarak sarıldığı aynı metin satırının düzeni.

Uygulama arşivleme

Android 和 Google Play 宣布支持最后的应用归档功能 年,这让用户可以通过移除部分内容来释放空间 通过 Android 应用发布的设备中不常用的应用 前往 Google Play 下载套装。Android 15 在操作系统级别支持应用归档和解压缩,让所有应用商店都能更轻松地实现归档和解压缩。

具有 REQUEST_DELETE_PACKAGES 权限的应用可以调用 PackageInstaller requestArchive 方法请求归档 已安装的应用软件包,这会移除 APK 和所有缓存的文件,但会保留 用户数据已归档的应用会通过 LauncherApps API 作为可显示的应用返回;用户会看到一个界面处理,以突出显示这些应用已归档。如果用户点按已归档的应用,负责安装的应用会收到解除归档请求,并且可以通过 ACTION_PACKAGE_ADDED 广播监控恢复过程。

Geliştirici seçeneklerini kullanarak bir cihazda 16 KB modunu etkinleştirme

Cihazı 16 KB modunda başlatmak için 16 KB sayfa boyutuyla başlat geliştirici seçeneğini etkinleştirin.

Android 15 QPR1'den itibaren, cihazı 16 KB modunda başlatmak ve cihaz üzerinde test yapmak için belirli cihazlarda bulunan geliştirici seçeneğini kullanabilirsiniz. Geliştirici seçeneğini kullanmadan önce Ayarlar > Sistem > Yazılım güncellemeleri'ne gidip varsa güncellemeleri uygulayın.

Bu geliştirici seçeneği aşağıdaki cihazlarda kullanılabilir:

  • Pixel 8 ve 8 Pro (Android 15 QPR1 veya sonraki sürümler)

  • Pixel 8a (Android 15 QPR1 veya sonraki sürümler)

  • Pixel 9, 9 Pro ve 9 Pro XL (Android 15 QPR2 Beta 2 veya sonraki sürümlerle)

Grafik

Android 15, ANGLE ve Canvas grafik sistemine eklemeler de dahil olmak üzere en yeni grafik iyileştirmelerini sunar.

Android'in GPU erişimini modernleştirme

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'ta yapılan iyileştirmeler

Android 15 continues our modernization of Android's Canvas graphics system with additional capabilities:

  • Matrix44 provides a 4x4 matrix for transforming coordinates that should be used when you want to manipulate the canvas in 3D.
  • clipShader intersects the current clip with the specified shader, while clipOutShader sets the clip to the difference of the current clip and the shader, each treating the shader as an alpha mask. This supports the drawing of complex shapes efficiently.

Performans ve pil

Android, uygulamalarınızın performansını ve kalitesini artırmanıza yardımcı olmaya odaklanmaya devam ediyor. Android 15, uygulamanızdaki görevlerin daha verimli bir şekilde yürütülmesine, uygulama performansının optimize edilmesine ve uygulamalarınızla ilgili analizler toplanmasına yardımcı olan API'ler sunar.

Pili verimli kullanmaya yönelik en iyi uygulamalar, ağ ve güç kullanımında hata ayıklama ve Android 15 ile Android'in son sürümlerinde arka planda yapılan işlerin pil verimliliğini nasıl artırdığımız hakkında ayrıntılı bilgi için Google I/O'daki Android'de arka planda yapılan işlerin pil verimliliğini artırma konuşmasına göz atın.

ApplicationStartInfo API

在以前的 Android 版本中,应用启动一直是个谜。在应用中确定应用是从冷启动、温启动还是热启动状态启动很困难。您还很难了解应用在各种启动阶段(分叉进程、调用 onCreate、绘制第一个帧等)所花的时间。在 Application 类被实例化时,您无法知道应用是通过广播、content provider、作业、备份、启动完成、闹钟还是 Activity 启动的。

Android 15 上的 ApplicationStartInfo API 提供了所有这些功能,以及更多功能。您甚至可以选择在流程中添加自己的时间戳,以便在一个位置收集时间数据。除了收集指标之外,您还可以使用 ApplicationStartInfo 直接优化应用启动;例如,您可以消除在应用因广播而启动时在 Application 类中实例化与界面相关的库所带来的高昂开销。

Ayrıntılı uygulama boyutu bilgileri

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.

Uygulama tarafından yönetilen profilleme

Android 15, uygulamanızdan yığın dökümleri, yığın profilleri, yığın örnekleme ve daha fazlası gibi profil oluşturma bilgilerini toplamanıza olanak tanıyan ProfilingManager sınıfını içerir. Uygulamanızın dosya dizinine yayınlanan çıkış dosyasını tanımlamak için sağlanan bir etiketle uygulamanıza geri çağırma sağlar. API, performans üzerindeki etkiyi en aza indirmek için hız sınırlaması yapar.

Uygulamanızda profil oluşturma istekleri oluşturmayı basitleştirmek için Core 1.15.0-rc01 veya sonraki sürümlerde bulunan ilgili Profiling AndroidX API'sini kullanmanızı öneririz.

SQLite veritabanı iyileştirmeleri

Android 15 引入了 SQLite API,这些 API 可公开底层 SQLite 引擎的高级功能,以解决可能在应用中出现的特定性能问题。将 SQLite 更新到版本 3.44.3

开发者应参阅 SQLite 性能最佳实践 以便充分利用其 SQLite 数据库,尤其是在处理大型 或运行对延迟敏感的查询时

Android Dinamik Performans Çerçevesi güncellemeleri

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

Gizlilik

Android 15, uygulama geliştiricilerin kullanıcı gizliliğini korumasına yardımcı olan çeşitli özellikler içerir.

Ekran kaydı algılama

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

Genişletilmiş IntentFilter özellikleri

Android 15 通过 UriRelativeFilterGroup 支持更精确的 Intent 解析,UriRelativeFilterGroup 包含一组 UriRelativeFilter 对象,这些对象构成一组必须满足的 Intent 匹配规则,包括网址查询参数、网址片段以及屏蔽或排除规则。

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

下面是一个 AndroidManifest 语法示例:

<intent-filter android:autoVerify="true">
  <action android:name="android.intent.action.VIEW" />
  <category android:name="android.intent.category.BROWSABLE" />
  <category android:name="android.intent.category.DEFAULT" />
  <data android:scheme="http" />
  <data android:scheme="https" />
  <data android:host="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>

Özel alan

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:

Seçili Fotoğraflara Erişim için en son kullanıcı seçimini sorgulama

Apps can now 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'de Özel Korumalı Alan

Android 15 includes the latest Android Ad Services extensions, incorporating the latest version of the Privacy Sandbox on Android. This addition is part of our work to develop technologies that improve user privacy and enable effective, personalized advertising experiences for mobile apps. Our privacy sandbox page has more information about the Privacy Sandbox on Android developer preview and beta programs to help you get started.

ve geri yükleme

Android 15 集成了与 Health Connect by Android 相关的最新扩展程序。Health Connect by Android 是一个安全的集中式平台,可用于管理和共享应用收集的健康与健身数据。此次更新 增加了对健身营养、体表温度、训练计划等。

体表温度追踪功能让用户可以更精确地存储和分享体表温度 来自穿戴式设备或其他跟踪设备的体温数据。

训练计划是一种结构化的锻炼计划,可帮助用户实现健身目标。训练计划支持各种完成和表现目标:

如需详细了解 Android 中 Health Connect 的最新更新,请参阅 利用 Android 打造自适应体验 健康演讲。

Uygulama ekran paylaşımı

Android 15 supports app screen sharing so users can share or record just an app window rather than the entire device screen. This feature, first enabled in Android 14 QPR2, includes MediaProjection callbacks that allow your app to customize the app screen sharing experience. Note that for apps targeting Android 14 (API level 34) or higher, user consent is required for each MediaProjection capture session.

Kullanıcı deneyimi ve sistem kullanıcı arayüzü

Android 15, uygulama geliştiricilere ve kullanıcılara cihazlarını ihtiyaçlarına göre yapılandırma konusunda daha fazla kontrol ve esneklik sunar.

Android 15'teki en son iyileştirmeleri kullanarak uygulamanızın kullanıcı deneyimini nasıl iyileştireceğiniz hakkında daha fazla bilgi edinmek için Google I/O'daki Android uygulamanızın kullanıcı deneyimini iyileştirme başlıklı konuşmayı izleyin.

Generated Previews API ile daha zengin widget önizlemeleri

在 Android 15 之前,提供微件选择器预览的唯一方法是指定静态图片或布局资源。这些预览通常与放置在主屏幕上的实际 widget 的外观大不相同。此外,由于无法使用 Jetpack Glance 创建静态资源,因此“资讯一览” 开发者必须为其微件截屏或创建 XML 布局, 微件预览。

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

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

推送 API

应用可以通过推送 API 提供生成的预览。应用可以提供 预览,并且不会收到明确的请求, 以提供预览。预览会保留在 AppWidgetService 中,并且主持人可以按需请求预览。以下示例加载了一个 XML 微件 并将其设置为预览:

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 回调。作为回应,微件宿主会重新加载其所有提供方信息。
  3. 显示微件预览时,主机会检查 AppWidgetProviderInfo.generatedPreviewCategories,如果所选类别可用,则调用 AppWidgetManager.getWidgetPreview 以返回此提供程序的已保存预览。

何时调用 setWidgetPreview

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

以下列表介绍了两大类预览用例:

  • 在 widget 预览中显示真实数据(例如个性化数据)的提供程序 或最新信息。这些提供商可以设置预览 已登录 Google 账号或已在其应用中完成初始配置。之后 可以设置一项定期任务,按照所选的节奏更新预览。 此类 widget 的示例包括照片、日历、天气或新闻 widget。
  • 在预览中显示静态信息或不显示任何数据的快捷操作 widget 的提供程序。这些提供程序可以在应用首次启动时设置预览一次。例如,快速开车便是此类微件的示例 操作 widget 或 Chrome 快捷方式 widget。

某些提供商可能会在基座接入模式选择器上显示静态预览,但真实的 信息。这些提供商应遵循指南 设置预览

Pencere İçinde Pencere

Android 15 introduces changes in Picture-in-Picture (PiP) ensuring an even smoother transition when entering into PiP mode. This will be beneficial for apps having UI elements overlaid on top of their main UI, which goes into PiP.

Developers use the onPictureInPictureModeChanged callback to define logic that toggles the visibility of the overlaid UI elements. This callback is triggered when the PiP enter or exit animation is completed. Beginning in Android 15, the PictureInPictureUiState class includes another state.

With this UI state, apps targeting Android 15 (API level 35) will observe the Activity#onPictureInPictureUiStateChanged callback being invoked with isTransitioningToPip() as soon as the PiP animation starts. There are many UI elements that are not relevant for the app when it is in PiP mode, for example views or layout that include information such as suggestions, upcoming video, ratings, and titles. When the app goes to PiP mode, use the onPictureInPictureUiStateChanged callback to hide these UI elements. When the app goes to full screen mode from the PiP window, use onPictureInPictureModeChanged callback to unhide these elements, as shown in the following examples:

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

This quick visibility toggle of irrelevant UI elements (for a PiP window) helps ensure a smoother and flicker-free PiP enter animation.

İyileştirilmiş Rahatsız Etmeyin kuralları

AutomaticZenRule, uygulamaların Dikkat'i özelleştirmesine olanak tanır Yönetim (Rahatsız Etmeyin) kuralları ve ne zaman etkinleştirileceğine veya devre dışı bırakılacağına karar verme oluşturabilirsiniz. Android 15, en iyi uygulamaları paylaşacağız. Aşağıdaki iyileştirmeler dahildir:

  • AutomaticZenRule öğesine türler ekleniyor ve sistemin özel uygulama yapmasına olanak tanıyor bazı kurallara uyması gerekir.
  • AutomaticZenRule uygulamasına simge eklenerek modların daha kullanışlı hale getirilmesine yardımcı olun fark edebilirsiniz.
  • AutomaticZenRule öğesine aşağıdakileri açıklayan bir triggerDescription dizesi ekleniyor kuralın kullanıcı için etkin olması gereken koşullar.
  • Eklenme zamanı ZenDeviceEffects AutomaticZenRule değerine ayarlayarak kuralların gri tonlama gibi öğeleri tetiklemesine izin verir gece moduna girebilir veya duvar kağıdını karartabilirsiniz.

Bildirim kanalları için VibrationEffect ayarlama

Android 15 supports setting rich vibrations for incoming notifications by channel using NotificationChannel.setVibrationEffect, so your users can distinguish between different types of notifications without having to look at their device.

Medya projeksiyonu durum çubuğu çipi ve otomatik durdurma

Media projection can expose private user information. A new, prominent status bar chip makes users aware of any ongoing screen projection. Users can tap the chip to stop screen casting, sharing, or recording. Also, for a more intuitive user experience, any in‑progress screen projection now automatically stops when the device screen is locked.

Ekran paylaşımı, yayınlama ve kayıt için durum çubuğu çipi.

Büyük ekranlar ve form faktörleri

Android 15, uygulamalarınızın büyük ekranlar, çevrilebilir ve katlanabilir cihazlar gibi Android'in form faktörlerinden en iyi şekilde yararlanmasını sağlar.

Büyük ekranda çoklu görev deneyimi artık daha iyi

Android 15, kullanıcıların büyük ekranlı cihazlarda çoklu görev gerçekleştirmeleri için daha iyi yöntemler sunar. Örneğin, Örneğin, kullanıcılar en sevdikleri bölünmüş ekran uygulama kombinasyonlarını hızlı bir şekilde görev çubuğuna dokunup sabitleyerek uygulamalar arasında kolayca geçiş yapabilirsiniz. Bunun anlamı şudur: uygulamanızın uyarlanabilir olmasını sağlamanın hiç olmadığı kadar önemli olduğunu unutmayın.

Google I/O, Uyarlanabilir Android'i Geliştirme uygulamalar ve Material 3 ile Kullanıcı Arayüzü Oluşturma uyarlanabilir kitaplık yardımcı olabilir ve dokümanlarımızda büyük müşteri memnuniyeti için ekranları için de geçerlidir.

Kapak ekranı desteği

Your app can declare a property that Android 15 uses to allow your Application or Activity to be presented on the small cover screens of supported flippable devices. These screens are too small to be considered as compatible targets for Android apps to run on, but your app can opt in to supporting them, making your app available in more places.

Bağlantı

Android 15, platformu güncelleyerek uygulamanızın iletişim ve kablosuz teknolojilerdeki en son gelişmelere erişmesini sağlar.

Uydu desteği

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

应用可以使用 ServiceState.isUsingNonTerrestrialNetwork() 执行以下操作: 检测设备是否连接到卫星,让他们更清楚地了解 可能会导致完全网络服务不可用的原因此外,Android 15 支持短信和彩信应用以及预加载的 RCS 应用,以便使用卫星连接发送和接收消息。

当设备连接到卫星时,系统会显示通知。

Daha sorunsuz NFC deneyimleri

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

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

Cüzdan rolü

Android 15 引入了钱包角色,可与用户的首选钱包应用更紧密地集成。此角色会取代 NFC 默认的感应式付款设置。用户可以前往设置 > 应用 > 默认应用,管理钱包角色持有者。

在为在付款类别中注册的 AID 路由 NFC 感应式付款时,系统会使用钱包角色。点按操作始终会转到 Google 钱包角色持有者,除非有已注册相同 AID 的其他应用在前台运行。

此角色还用于确定“Google 钱包”快速访问功能块在启用后应显示在何处。将角色设为“无”时,“快速访问”功能块不可用,并且支付类别 NFC 点按仅传送到前台应用。

Güvenlik

Android 15, uygulamanızın güvenliğini artırmanıza, uygulamanızın verilerini korumanıza ve kullanıcılara verileri üzerinde daha fazla şeffaflık ve kontrol imkanı sunmanıza yardımcı olur. Kullanıcı güvenliğini artırmak ve uygulamanızı yeni tehditlere karşı korumak için neler yaptığımız hakkında daha fazla bilgi edinmek isterseniz Google I/O'daki Android'de kullanıcı güvenliğini sağlama konuşmasına göz atın.

Kimlik Bilgisi Yöneticisi'ni otomatik doldurma özelliğiyle entegre etme

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.

Tek dokunuşla kaydolma ve oturum açma özelliğini biyometrik istemlerle entegre edin

Credential Manager将生物识别提示集成到凭据创建过程中 和登录流程,这样提供商就无需管理 生物识别提示。因此,凭据提供程序只需专注于创建和获取流程的结果,并辅以生物识别流程结果。这一简化的流程创建了更高效、更精简的凭据 创建和检索过程。

Uçtan uca şifreleme için anahtar yönetimi

We are introducing the E2eeContactKeysManager in Android 15, which facilitates end-to-end encryption (E2EE) in your Android apps by providing an OS-level API for the storage of cryptographic public keys.

The E2eeContactKeysManager is designed to integrate with the platform contacts app to give users a centralized way to manage and verify their contacts' public keys.

İçerik URI'lerinde izin denetimleri

Android 15 introduces a set of APIs that perform permission checks on content URIs:

Erişilebilirlik

Android 15, kullanıcılar için erişilebilirliği artıran özellikler ekler.

Daha iyi Braille

在 Android 15 中,我们让 TalkBack 能够支持通过 USB 和安全蓝牙使用 HID 标准的盲文显示屏。

此标准与鼠标和键盘使用的标准非常相似,将有助于 Android 随着时间的推移支持更多类型的盲文显示屏。

Uluslararası hale getirme

Android 15, cihaz farklı dillerde kullanılırken kullanıcı deneyimini tamamlayan özellikler ve işlevler ekler.

CJK değişken yazı tipi

Starting with Android 15, the font file for Chinese, Japanese, and Korean (CJK) languages, NotoSansCJK, is now a variable font. Variable fonts open up possibilities for creative typography in CJK languages. Designers can explore a broader range of styles and create visually striking layouts that were previously difficult or impossible to achieve.

How the variable font for Chinese, Japanese, and Korean (CJK) languages appears with different font widths.

Karakterler arası gerekçe

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 JUSTIFICATION_MODE_INTER_CHARACTER.
Layout for English text using the JUSTIFICATION_MODE_INTER_CHARACTER.

Otomatik satır sonu yapılandırması

Android, İngilizcede Japonca ve Korece için sıralı tabanlı satır sonlarını desteklemeye başladı. Android 13 (API düzeyi 33). Ancak sıralı tabanlı satır sonları, metinler okunaklı olduğundan, uzun metin satırlarında iyi performans göstermez. Android 15'te uygulamalar, LINE_BREAK_WORD_STYLE_AUTO seçeneğini kullanarak ifade tabanlı satır aralarını yalnızca kısa metin satırları için uygulayabilir. Bu seçenek, metin için en iyi kelime stili seçeneğini belirler.

Kısa metin satırları için, aynı işlevi gören kelime öbeğine dayalı satır sonları kullanılır. aşağıda gösterildiği gibi LINE_BREAK_WORD_STYLE_PHRASE olarak şu resim:

Kısa metin satırlarında LINE_BREAK_WORD_STYLE_AUTO Metnin okunabilirliğini artırmak için sıralı satır sonları uygular. Bu, LINE_BREAK_WORD_STYLE_PHRASE.

Daha uzun metin satırları için LINE_BREAK_WORD_STYLE_AUTO, hayır kullanır aynı şekilde çalışan satır sonu kelime stili LINE_BREAK_WORD_STYLE_NONE, şu resim:

Uzun metin satırları için LINE_BREAK_WORD_STYLE_AUTO Metnin okunabilirliğini artırmak için satır sonu kelime stili uygulamaz. Bu, LINE_BREAK_WORD_STYLE_NONE.

Ek Japonca Hentaigana Yazı Tipi

在 Android 15 中,旧版日语平假名(也称为 Hentaigana)字体文件 捆绑在一起半形人物的独特形状可以增加 风格或设计独特的风格 传播和理解古代日本文件的能力。

日文半角字符和文本样式 字体。

VideoLAN 圆锥图标 版权所有 (c) 1996-2010 VideoLAN。任何人都可以使用此徽标或修改版徽标来提及 VideoLAN 项目或 VideoLAN 团队开发的任何产品,但这并不表示该项目对其表示认可。

Vulkan 和 Vulkan 徽标是 Khronos Group Inc.的注册商标。

OpenGL 是注册商标,OpenGL ES 徽标是 Hewlett Packard Enterprise 的商标,已获得 Khronos 的许可。