نمای کلی ویژگی ها و API ها

اندروید 15 ویژگی ها و API های عالی را برای توسعه دهندگان معرفی می کند. بخش‌های زیر این ویژگی‌ها را خلاصه می‌کنند تا به شما در شروع کار با APIهای مرتبط کمک کنند.

برای فهرست دقیق APIهای اضافه شده، اصلاح شده و حذف شده، گزارش تفاوت API را بخوانید. برای جزئیات بیشتر در مورد APIهای اضافه شده به مرجع Android API مراجعه کنید — برای Android 15، به دنبال APIهایی بگردید که در سطح API 35 اضافه شده اند. برای اطلاع از مناطقی که تغییرات پلت فرم ممکن است بر برنامه های شما تأثیر بگذارد، حتماً تغییرات رفتار Android 15 را برای برنامه هایی که Android 15 و برای همه برنامه ها را هدف قرار می دهند بررسی کنید.

دوربین و رسانه

اندروید 15 شامل ویژگی‌های مختلفی است که تجربه دوربین و رسانه را بهبود می‌بخشد و به شما امکان می‌دهد به ابزارها و سخت‌افزارهایی برای حمایت از سازندگان برای زنده کردن دیدگاه‌شان در اندروید دسترسی داشته باشید.

برای اطلاعات بیشتر در مورد جدیدترین ویژگی‌ها و راه‌حل‌های برنامه‌نویس برای رسانه و دوربین Android، به بحث ساخت رسانه‌ها و تجربه‌های دوربین مدرن Android از Google I/O مراجعه کنید.

تقویت نور کم

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

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

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

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

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

کنترل های دوربین درون برنامه ای

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

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.

دستگاه های مجازی MIDI 2.0

Android 13 added support for connecting to MIDI 2.0 devices using USB, which communicate using Universal MIDI Packets (UMP). Android 15 extends UMP support to virtual MIDI apps, enabling composition apps to control synthesizer apps as a virtual MIDI 2.0 device just like they would with an USB MIDI 2.0 device.

رمزگشایی نرم افزار AV1 کارآمدتر

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.

بهره وری توسعه دهندگان و ابزار

در حالی که بیشتر کار ما برای بهبود بهره‌وری شما حول ابزارهایی مانند Android Studio ، Jetpack Compose ، و کتابخانه‌های Android Jetpack متمرکز است، ما همیشه به دنبال راه‌هایی در این پلتفرم هستیم تا به شما کمک کند راحت‌تر به دیدگاه خود پی ببرید.

به روز رسانی OpenJDK 17

Android 15 将继续更新 Android 的核心库,以与最新 OpenJDK LTS 版本中的功能保持一致。

其中包含以下主要功能和改进:

这些 API 会通过 Google Play 系统更新在搭载 Android 12(API 级别 31)及更高版本的 10 亿多部设备上更新,以便您以最新的编程功能为目标平台。

پیشرفت های PDF

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

اصلاحات تغییر خودکار زبان

اندروید 14 روی دستگاه، تشخیص چند زبانه در صدا با جابجایی خودکار بین زبان‌ها را اضافه کرده است، اما این می‌تواند باعث حذف کلمات شود، به خصوص زمانی که زبان‌ها با مکث کمتری بین دو گفته جابجا می‌شوند. Android 15 کنترل‌های اضافی را اضافه می‌کند تا به برنامه‌ها کمک کند این تغییر را در مورد استفاده خود تنظیم کنند. EXTRA_LANGUAGE_SWITCH_INITIAL_ACTIVE_DURATION_TIME_MILLIS تغییر خودکار را به ابتدای جلسه صوتی محدود می کند، در حالی که EXTRA_LANGUAGE_SWITCH_MATCH_SWITCHES تغییر زبان را پس از تعداد معینی سوئیچ غیرفعال می کند. این گزینه‌ها مخصوصاً زمانی مفید هستند که انتظار دارید در طول جلسه یک زبان صحبت شود که باید به طور خودکار شناسایی شود.

API فونت متغیر OpenType بهبود یافته است

Android 15 improves the usability of the OpenType variable font. You can 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 API 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.

کنترل های شکست خط دانه ای

从 Android 15 开始,TextView 和底层行断开符可以将给定部分文本保留在同一行中,以提高可读性。您可以通过在字符串资源或 createNoBreakSpan 中使用 <nobreak> 标记来充分利用此换行符自定义功能。同样,您可以使用 <nohyphen> 标记或 createNoHyphenationSpan 来防止对字词进行分词。

例如,以下字符串资源不包含换行符,在呈现时,文本“Pixel 8 Pro”会在不合适的位置换行:

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

相比之下,此字符串资源包含 <nobreak> 标记,该标记会将字词“Pixel 8 Pro”换行,并防止换行:

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

以下图片展示了这些字符串呈现方式的差异:

一行文本的布局,其中显示短语“Pixel 8 Pro.”未使用 <nobreak> 标记换行。
使用 <nobreak> 标记封装“Pixel 8 Pro.”短语的同一行文本的布局。

بایگانی برنامه

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

使用开发者选项在设备上启用 16 KB 模式

切换以 16KB 页面大小启动设备开发者选项,以便在 16 KB 模式下启动设备。

从 Android 15 QPR1 开始,您可以使用某些设备上提供的开发者选项,以 16 KB 模式启动设备并执行设备端测试。在使用开发者选项之前,请依次前往“设置”->“系统”->“软件更新”,然后应用所有可用的更新。

此开发者选项适用于以下设备:

  • Pixel 8 和 Pixel 8 Pro(搭载 Android 15 QPR1 或更高版本)

    警告:由于 Android 15 QPR2 Beta 版 3 存在已知问题,在安装 Android 15 QPR2 Beta 版 3 并以 16 KB 模式启动设备后,Pixel 8 设备上的触摸屏无法正常使用。此问题不会影响 Pixel 8 Pro 设备。

  • Pixel 8a(搭载 Android 15 QPR1 或更高版本)

    警告:由于 Android 15 QPR2 Beta 版 3 存在已知问题,在安装 Android 15 QPR2 Beta 版 3 并以 16 KB 模式启动设备后,Pixel 8a 设备上的触摸屏无法正常使用。

  • Pixel 9、Pixel 9 Pro 和 Pixel 9 Pro XL(搭载 Android 15 QPR2 Beta 2 或更高版本)

گرافیک

اندروید 15 جدیدترین پیشرفت‌های گرافیکی، از جمله ANGLE و اضافه‌شده‌ها به سیستم گرافیکی Canvas را به ارمغان می‌آورد.

مدرن کردن دسترسی به پردازنده گرافیکی اندروید

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

بهبودهایی برای بوم

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

  • Matrix44 提供一个 4x4 矩阵来转换坐标,当您想在 3D 中操控画布时,应使用此矩阵。
  • clipShader 会将当前剪裁区域与指定的着色器相交,而 clipOutShader 会将剪裁区域设为当前剪裁区域与着色器的差值,每个操作都会将着色器视为一个 Alpha 遮罩。这支持高效地绘制复杂形状。

عملکرد و باتری

Android به تمرکز خود بر کمک به شما در بهبود عملکرد و کیفیت برنامه‌هایتان ادامه می‌دهد. Android 15 API هایی را معرفی می کند که به کارآمدتر کردن وظایف در برنامه شما برای اجرا، بهینه سازی عملکرد برنامه و جمع آوری اطلاعات بینش در مورد برنامه های شما کمک می کند.

برای بهترین شیوه‌های کارآمد باتری، اشکال‌زدایی شبکه و مصرف انرژی، و جزئیات نحوه بهبود کارایی باتری در کار پس‌زمینه در Android 15 و نسخه‌های اخیر Android، به بهبود کارایی باتری در کار پس‌زمینه در بحث Android از Google I/O مراجعه کنید.

ApplicationStartInfo API

In previous versions of Android, app startup has been a bit of a mystery. It was challenging to determine within your app whether it started from a cold, warm, or hot state. It was also difficult to know how long your app spent during the various launch phases: forking the process, calling onCreate, drawing the first frame, and more. When your Application class was instantiated, you had no way of knowing whether the app started from a broadcast, a content provider, a job, a backup, boot complete, an alarm, or an Activity.

The ApplicationStartInfo API on Android 15 provides all of this and more. You can even choose to add your own timestamps into the flow to help collect timing data in one place. In addition to collecting metrics, you can use ApplicationStartInfo to help directly optimize app startup; for example, you can eliminate the costly instantiation of UI-related libraries within your Application class when your app is starting up due to a broadcast.

اطلاعات دقیق اندازه برنامه

从 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 است که به شما امکان می‌دهد اطلاعات پروفایل را از داخل برنامه خود جمع‌آوری کنید، مانند heap dumps، heap profiles، stack sampling و موارد دیگر. این یک تگ ارائه شده برای شناسایی فایل خروجی که به دایرکتوری فایل های برنامه شما تحویل داده می شود، به برنامه شما پاسخ تماس می دهد. API برای به حداقل رساندن تأثیر عملکرد، نرخ را محدود می کند.

برای ساده‌سازی درخواست‌های نمایه‌سازی در برنامه‌تان، توصیه می‌کنیم از Profiling AndroidX API مربوطه، موجود در Core 1.15.0-rc01 یا بالاتر استفاده کنید.

بهبود پایگاه داده SQLite

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

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

به‌روزرسانی‌های چارچوب عملکرد پویا اندروید

Android 15 继续投资于 Android 动态性能框架 (ADPF),这是一组 API,可让游戏和性能密集型应用更为直接地与 Android 设备的电源和散热系统进行互动。在受支持的设备上,Android 15 添加了 ADPF 功能:

  • 针对提示会话的节能模式,用于指明其关联的线程应优先节能而非性能,非常适合长时间运行的后台工作负载。
  • 系统可以在提示会话中报告 GPU 和 CPU 工作时长,以便同时调整 CPU 和 GPU 频率,以最佳方式满足工作负载需求。
  • 热余量阈值,用于根据余量预测来解读可能的热节流状态。

如需详细了解如何在应用和游戏中使用 ADPF,请参阅相关文档

حریم خصوصی

اندروید 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 解析,UriRelativeFilterGroup 包含一组 UriRelativeFilter 对象,这些对象构成一组必须满足的 Intent 匹配规则,包括网址查询参数、网址片段以及屏蔽或排除规则。

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

下面是一个 AndroidManifest 语法示例:

<intent-filter>
  <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: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>

فضای خصوصی

فضای خصوصی را می توان برای نمایش یا پنهان کردن برنامه های حساس روی دستگاه باز و قفل کرد.

فضای خصوصی به کاربران این امکان را می دهد که فضای جداگانه ای در دستگاه خود ایجاد کنند که در آن می توانند برنامه های حساس را از چشمان کنجکاو دور نگه دارند، زیر یک لایه دیگر از احراز هویت. فضای خصوصی از یک پروفایل کاربری مجزا استفاده می کند. کاربر می تواند انتخاب کند که از قفل دستگاه یا فاکتور قفل جداگانه برای فضای خصوصی استفاده کند.

برنامه‌های موجود در فضای خصوصی در یک محفظه جداگانه در راه‌انداز نمایش داده می‌شوند و وقتی فضای خصوصی قفل است از نمای اخیر، اعلان‌ها، تنظیمات و از سایر برنامه‌ها پنهان می‌شوند. محتوای تولید شده و دانلود شده توسط کاربر (مانند رسانه یا فایل ها) و حساب ها بین فضای خصوصی و فضای اصلی جدا می شوند. از اشتراک‌گذاری سیستم و انتخابگر عکس می‌توان برای دسترسی برنامه‌ها به محتوا در فضاهای مختلف زمانی که فضای خصوصی باز است استفاده کرد.

کاربران نمی توانند برنامه های موجود و داده های آنها را به فضای خصوصی منتقل کنند. در عوض، کاربران یک گزینه نصب را در فضای خصوصی برای نصب یک برنامه با استفاده از فروشگاه برنامه ای که ترجیح می دهند انتخاب می کنند. برنامه‌های موجود در فضای خصوصی به‌عنوان نسخه‌های جداگانه از هر برنامه‌ای در فضای اصلی (کپی‌های جدید همان برنامه) نصب می‌شوند.

وقتی کاربر فضای خصوصی را قفل می کند، نمایه متوقف می شود. وقتی نمایه متوقف شده است، برنامه‌های موجود در فضای خصوصی دیگر فعال نیستند و نمی‌توانند فعالیت‌های پیش‌زمینه یا پس‌زمینه، از جمله نمایش اعلان‌ها را انجام دهند.

توصیه می کنیم برنامه خود را با فضای خصوصی آزمایش کنید تا مطمئن شوید برنامه شما همانطور که انتظار می رود کار می کند، به خصوص اگر برنامه شما در یکی از دسته های زیر قرار می گیرد:

آخرین انتخاب کاربر را برای دسترسی به عکس‌های انتخابی جستجو کنید

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

Health Connect

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

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

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

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

اشتراک گذاری صفحه نمایش برنامه

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.

تجربه کاربری و رابط کاربری سیستم

اندروید 15 به توسعه دهندگان و کاربران برنامه کنترل و انعطاف بیشتری را برای پیکربندی دستگاه خود مطابق با نیازهایشان می دهد.

برای کسب اطلاعات بیشتر در مورد نحوه استفاده از آخرین پیشرفت‌ها در Android 15 برای بهبود تجربه کاربری برنامه، به بحث بهبود تجربه کاربری برنامه Android خود از Google I/O مراجعه کنید.

پیش‌نمایش‌های غنی‌تر ویجت با Generated Previews API

Before Android 15, the only way to provide widget picker previews was to specify a static image or layout resource. These previews often differ significantly from the look of the actual widget when it is placed on the home screen. Also, static resources can't be created with Jetpack Glance, so a Glance developer had to screenshot their widget or create an XML layout to have a widget preview.

Android 15 adds support for generated previews. This means that app widget providers can generate RemoteViews to use as the picker preview, instead of a static resource.

Apps can provide Remote Views to the Widget Picker, so they can update the content in the picker to be more representative of what the user will see.

Push API

Apps can provide generated previews through a push API. Apps can provide previews at any point in their lifecycle, and don't receive an explicit request from the host to provide previews. Previews are persisted in AppWidgetService, and hosts can request them on-demand. The following example loads an XML widget layout resource and sets it as the preview:

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

The expected flow is:

  1. At any time, the widget provider calls setWidgetPreview. The provided previews are persisted in AppWidgetService with other provider info.
  2. setWidgetPreview notifies hosts of an updated preview through the AppWidgetHost.onProvidersChanged callback. In response, the widget host reloads all of its provider information.
  3. When displaying a widget preview, the host checks AppWidgetProviderInfo.generatedPreviewCategories, and if the chosen category is available, calls AppWidgetManager.getWidgetPreview to return the saved preview for this provider.

When to call setWidgetPreview

Because there is no callback to provide previews, apps can choose to send previews at any point when they are running. How often to update the preview depends on the widget's use case.

The following list describes the two main categories of preview use cases:

  • Providers that show real data in their widget previews, such as personalized or recent information. These providers can set the preview once the user has signed in or has done initial configuration in their app. After this, they can set up a periodic task to update the previews at their chosen cadence. Examples of this type of widget could be a photo, calendar, weather or news widget.
  • Providers that show static information in previews or quick-action widgets that don't display any data. These providers can set previews once, when the app first launches. Examples of this type of widget include a drive quick actions widget or chrome shortcuts widget.

Some providers might show static previews on the hub mode picker, but real information on the homescreen picker. These providers should follow the guidance for both of these use cases to set previews.

تصویر در تصویر

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.

قوانین مزاحم نشوید بهبود یافته است

AutomaticZenRule 允许应用自定义注意力机制 管理(勿扰)规则,并确定何时启用或停用 。Android 15 极大地增强了这些规则,旨在提高 用户体验。其中包含以下增强功能:

  • AutomaticZenRule 添加类型,让系统能够应用特殊类型 对某些规则的处理
  • AutomaticZenRule 添加图标,使模式更加丰富 易于识别。
  • triggerDescription 字符串添加到 AutomaticZenRule,用于描述 规则应当对用户生效的条件。
  • 已添加 ZenDeviceEffects 更改为AutomaticZenRule,从而允许规则触发灰度等操作 显示、夜间模式或调暗壁纸。

VibrationEffect را برای کانال های اعلان تنظیم کنید

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.

تراشه نوار وضعیت نمایش رسانه و توقف خودکار

媒体投放可能会泄露用户的私密信息。一个醒目的新状态栏条状标签可让用户了解任何正在进行的屏幕投影。用户可以点按该条状标签停止投屏、共享或录制屏幕。此外,为了提供更直观的用户体验,当设备屏幕锁定后,所有正在进行的屏幕投影都会自动停止。

Status bar chip for screen sharing, casting, and recording.

صفحه نمایش های بزرگ و عوامل شکل

Android 15 به برنامه‌های شما پشتیبانی می‌کند تا از فاکتورهای فرم اندروید، از جمله صفحه‌نمایش‌های بزرگ، قابلیت‌های تاشو، و تاشو نهایت استفاده را ببرند.

چندوظیفه ای با صفحه نمایش بزرگ بهبود یافته است

Android 15 为用户提供了在大屏设备上更好地进行多任务处理的方式。对于 例如,用户可以保存自己喜爱的分屏应用组合, 访问并固定屏幕上的任务栏,以便在应用之间快速切换。这意味着 让应用具备自适应能力比以往任何时候都更加重要。

Google I/O 大会上有一些关于构建自适应 Android 的会议 应用使用 Material 3 构建界面 自适应库 我们的文档中提供了更多帮助信息,帮助您针对大型语言 。

پشتیبانی از صفحه نمایش پوششی

您的应用可以声明一个属性,Android 15 会使用该属性来允许您的 ApplicationActivity 显示在受支持的可翻转设备的小封面屏幕上。这些屏幕太小,无法被视为适合运行 Android 应用的兼容目标平台,但您的应用可以选择支持它们,从而让您的应用在更多平台上可用。

قابلیت اتصال

Android 15 پلتفرم را به روز می کند تا برنامه شما به آخرین پیشرفت ها در زمینه ارتباطات و فناوری های بی سیم دسترسی داشته باشد.

پشتیبانی ماهواره ای

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

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

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

تجربه های روان تر NFC

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

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

نقش کیف پول

Android 15 introduces a 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 Quick Access tile should go when activated. When the role is set to "None", the Quick Access tile isn't available and payment category NFC taps are only delivered to the foreground app.

امنیت

Android 15 به شما کمک می کند امنیت برنامه خود را افزایش دهید، از داده های برنامه خود محافظت کنید، و به کاربران شفافیت و کنترل بیشتری بر روی داده های خود می دهد. برای اطلاعات بیشتر در مورد کارهایی که برای بهبود ایمنی کاربر و محافظت از برنامه شما در برابر تهدیدات جدید انجام می دهیم، گفتگوی حفاظت از امنیت کاربر در Android را از Google I/O ببینید.

مدیریت اعتبار را با تکمیل خودکار ادغام کنید

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

مدیریت کلید برای رمزگذاری سرتاسر

ما E2eeContactKeysManager را در اندروید 15 معرفی می کنیم که رمزگذاری سرتاسر (E2EE) را در برنامه های اندرویدی شما با ارائه یک API در سطح سیستم عامل برای ذخیره کلیدهای عمومی رمزنگاری تسهیل می کند.

E2eeContactKeysManager برای ادغام با برنامه مخاطبین پلتفرم طراحی شده است تا به کاربران راهی متمرکز برای مدیریت و تأیید کلیدهای عمومی مخاطبینشان بدهد.

مجوزهای URI محتوا را بررسی می کند

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

دسترسی

اندروید 15 ویژگی هایی را اضافه می کند که دسترسی کاربران را بهبود می بخشد.

خط بریل بهتر

In Android 15, we've made it possible for TalkBack to support Braille displays that are using the HID standard over both USB and secure Bluetooth.

This standard, much like the one used by mice and keyboards, will help Android support a wider range of Braille displays over time.

بین المللی شدن

اندروید 15 ویژگی‌ها و قابلیت‌هایی را اضافه می‌کند که تجربه کاربر را در هنگام استفاده از دستگاه به زبان‌های مختلف تکمیل می‌کند.

فونت متغیر CJK

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.

توجیه بین شخصیتی

从 Android 15 开始,可以通过 使用 JUSTIFICATION_MODE_INTER_CHARACTER。“字词间的理由”原为 最初是在 Android 8.0(API 级别 26)中引入的, Justifications 功能为使用 例如中文、日语等。

使用 JUSTIFICATION_MODE_NONE 的日语文本布局。
使用 JUSTIFICATION_MODE_NONE 的英语文本布局。


使用 JUSTIFICATION_MODE_INTER_WORD 的日语文本布局。
使用 JUSTIFICATION_MODE_INTER_WORD 的英语文本布局。


使用 JUSTIFICATION_MODE_INTER_CHARACTER 的日语文本布局。
使用 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 است.

فونت ژاپنی Hentaigana اضافی

در اندروید 15، یک فایل فونت برای هیراگانای ژاپنی قدیمی (معروف به Hentaigana) به طور پیش فرض همراه است. اشکال منحصربه‌فرد شخصیت‌های هنتایگانا می‌تواند استعدادی متمایز به آثار هنری یا طراحی اضافه کند و در عین حال به حفظ انتقال دقیق و درک اسناد باستانی ژاپنی کمک کند.

کاراکتر و سبک متن برای فونت ژاپنی Hentaigana.

VideoLAN cone Copyright (c) 1996-2010 VideoLAN. This logo or a modified version may be used or modified by anyone to refer to the VideoLAN project or any product developed by the VideoLAN team, but does not indicate endorsement by the project.

Vulkan and the Vulkan logo are registered trademarks of the Khronos Group Inc.

OpenGL is a registered trademark and the OpenGL ES logo is a trademark of Hewlett Packard Enterprise used by permission by Khronos.