Android 14 mang đến cho nhà phát triển các tính năng và API tuyệt vời. Các phần sau đây giúp bạn tìm hiểu các tính năng cho ứng dụng cũng như làm quen với các API liên quan.
Để biết danh sách chi tiết về các API đã thêm, sửa đổi và xoá, hãy đọc báo cáo điểm khác biệt về API. Để biết thông tin chi tiết về các API đã thêm, hãy truy cập Tài liệu tham khảo về API cho Android — để biết Android 14, tìm các API đã được thêm vào API cấp 34. Để tìm hiểu những thay đổi của nền tảng có thể tác động đến ứng dụng của bạn, hãy nhớ tham khảo các thay đổi về hành vi của Android 14 đối với ứng dụng nhắm đến Android 14 và tất cả ứng dụng.
Quốc tế hoá
Lựa chọn ưu tiên về ngôn ngữ cho mỗi ứng dụng
Android 14 扩展了 Android 13(API 级别 33)中引入的按应用设定语言功能,并包含以下额外功能:
自动生成应用的
localeConfig
:从 Android Studio Giraffe Canary 7 和 AGP 8.1.0-alpha07 开始,您可以将应用配置为自动支持各应用语言偏好设定。Android Gradle 插件会根据您的项目资源生成LocaleConfig
文件,并在最终清单文件中添加对该文件的引用,这样您就不再需要手动创建或更新该文件。AGP 使用应用模块的res
文件夹中的资源以及任何库模块依赖项来确定要在LocaleConfig
文件中添加的语言区域。动态更新应用的
localeConfig
:使用LocaleManager
方法中的setOverrideLocaleConfig()
和getOverrideLocaleConfig()
可以在设备的系统设置中动态更新应用的受支持语言列表。有了这种灵活性,您可以按区域自定义支持的语言列表、运行 A/B 实验,或者如果您的应用通过服务器端推送进行本地化,则可以提供更新后的语言区域列表。输入法 (IME) 的应用语言可见性:IME 可以利用
getApplicationLocales()
方法查看当前应用的语言,并将 IME 语言与该语言进行匹配。
API Biến tố ngữ pháp
有 30 亿人在使用区分性别的语言,此类语言的语法类别(例如名词、动词、形容词和介词)会根据您交谈所涉及的人或物的性别而变化。传统上,许多区分性别的语言使用阳性语法性别作为默认或通用性别。
以错误的语法性别来称呼用户,例如以阳性语法性别来称呼女性,可能会对她们的表现和态度产生负面影响。相比之下,界面语言如果能正确反映用户的语法性别,就可以提高用户互动度,并提供更个性化、更自然的用户体验。
为帮助您针对区分性别的语言构建以用户为中心的界面,Android 14 引入了 Grammatical Inflection API,让您无需重构应用便能添加对语法性别的支持。
Lựa chọn ưu tiên theo khu vực
Regional preferences enable users to personalize temperature units, the first day of the week, and numbering systems. A European living in the United States might prefer temperature units to be in Celsius rather than Fahrenheit and for apps to treat Monday as the beginning of the week instead of the US default of Sunday.
New Android Settings menus for these preferences provide users with a
discoverable and centralized location to change app preferences. These
preferences also persist through backup and restore. Several APIs and
intents—such as
getTemperatureUnit
and
getFirstDayOfWeek
—
grant your app read access to user preferences, so your app can adjust how it
displays information. You can also register a
BroadcastReceiver
on
ACTION_LOCALE_CHANGED
to handle locale configuration changes when regional preferences change.
To find these settings, open the Settings app and navigate to System > Languages & input > Regional preferences.


Hỗ trợ tiếp cận
Điều chỉnh tỷ lệ phông chữ phi tuyến tính lên đến 200%
Starting in Android 14, the system supports font scaling up to 200%, providing low-vision users with additional accessibility options that align with Web Content Accessibility Guidelines (WCAG).
To prevent large text elements on screen from scaling too large, the system applies a nonlinear scaling curve. This scaling strategy means that large text doesn't scale at the same rate as smaller text. Nonlinear font scaling helps preserve the proportional hierarchy between elements of different sizes while mitigating issues with linear text scaling at high degrees (such as text being cut off or text that becomes harder to read due to an extremely large display sizes).
Test your app with nonlinear font scaling

If you already use scaled pixels (sp) units to define text sizing, then these additional options and scaling improvements are applied automatically to the text in your app. However, you should still perform UI testing with the maximum font size enabled (200%) to ensure that your app applies the font sizes correctly and can accommodate larger font sizes without impacting usability.
To enable 200% font size, follow these steps:
- Open the Settings app and navigate to Accessibility > Display size and text.
- For the Font size option, tap the plus (+) icon until the maximum font size setting is enabled, as shown in the image that accompanies this section.
Use scaled pixel (sp) units for text-sizes
Remember to always specify text sizes in sp units. When your app uses sp units, Android can apply the user's preferred text size and scale it appropriately.
Don't use sp units for padding or define view heights assuming implicit padding: with nonlinear font scaling sp dimensions might not be proportional, so 4sp + 20sp might not equal 24sp.
Convert scaled pixel (sp) units
Use TypedValue.applyDimension()
to convert from sp units
to pixels, and use TypedValue.deriveDimension()
to
convert pixels to sp. These methods apply the appropriate nonlinear scaling
curve automatically.
Avoid hardcoding equations using
Configuration.fontScale
or
DisplayMetrics.scaledDensity
. Because font scaling is
nonlinear, the scaledDensity
field is no longer accurate. The fontScale
field should be used for informational purposes only because fonts are no longer
scaled with a single scalar value.
Use sp units for lineHeight
Always define android:lineHeight
using sp units instead
of dp, so the line height scales along with your text. Otherwise, if your text
is sp but your lineHeight
is in dp or px, it doesn't scale and looks cramped.
TextView automatically corrects the lineHeight
so that your intended
proportions are preserved, but only if both textSize
and lineHeight
are
defined in sp units.
Máy ảnh và nội dung nghe nhìn
Ultra HDR cho hình ảnh

Android 14 adds support for High Dynamic Range (HDR) images that retain more of the information from the sensor when taking a photo, which enables vibrant colors and greater contrast. Android uses the Ultra HDR format, which is fully backward compatible with JPEG images, allowing apps to seamlessly interoperate with HDR images, displaying them in Standard Dynamic Range (SDR) as needed.
Rendering these images in the UI in HDR is done automatically by the framework
when your app opts in to using HDR UI for its Activity Window, either through a
manifest entry or at runtime by calling
Window.setColorMode()
. You can also capture compressed Ultra
HDR still images on supported devices. With more colors recovered
from the sensor, editing in post can be more flexible. The
Gainmap
associated with Ultra HDR images can be used to render
them using OpenGL or Vulkan.
Thu phóng, Lấy nét, Xem sau và các tính năng khác trong các tiện ích của máy ảnh
Android 14 upgrades and improves camera extensions, allowing apps to handle longer processing times, which enables improved images using compute-intensive algorithms like low-light photography on supported devices. These features give users an even more robust experience when using camera extension capabilities. Examples of these improvements include:
- Dynamic still capture processing latency estimation provides much more
accurate still capture latency estimates based on the current scene and
environment conditions. Call
CameraExtensionSession.getRealtimeStillCaptureLatency()
to get aStillCaptureLatency
object that has two latency estimation methods. ThegetCaptureLatency()
method returns the estimated latency betweenonCaptureStarted
andonCaptureProcessStarted()
, and thegetProcessingLatency()
method returns the estimated latency betweenonCaptureProcessStarted()
and the final processed frame being available. - Support for capture progress callbacks so that apps can display the current
progress of long-running, still-capture processing operations. You can check
if this feature is available with
CameraExtensionCharacteristics.isCaptureProcessProgressAvailable
, and if it is, you implement theonCaptureProcessProgressed()
callback, which has the progress (from 0 to 100) passed in as a parameter. Extension specific metadata, such as
CaptureRequest.EXTENSION_STRENGTH
for dialing in the amount of an extension effect, such as the amount of background blur withEXTENSION_BOKEH
.Postview Feature for Still Capture in camera extensions, which provides a less-processed image more quickly than the final image. If an extension has increased processing latency, a postview image could be provided as a placeholder to improve UX and switched out later for the final image. You can check if this feature is available with
CameraExtensionCharacteristics.isPostviewAvailable
. Then you can pass anOutputConfiguration
toExtensionSessionConfiguration.setPostviewOutputConfiguration
.Support for
SurfaceView
allowing for a more optimized and power-efficient preview render path.Support for tap to focus and zoom during extension usage.
Thu phóng trong cảm biến
当 CameraCharacteristics
中的 REQUEST_AVAILABLE_CAPABILITIES_STREAM_USE_CASE
包含 SCALER_AVAILABLE_STREAM_USE_CASES_CROPPED_RAW
时,您的应用可以使用高级传感器功能,将剪裁后的 RAW 数据流的像素与全视野范围相同,方法是将 CaptureRequest
与将数据流用例设置为 CameraMetadata.SCALER_AVAILABLE_STREAM_USE_CASES_CROPPED_RAW
的 RAW 目标搭配使用。通过实现请求替换控件,更新后的相机可让用户在其他相机控件准备就绪之前使用缩放控件。
Âm thanh USB không tổn hao
Android 14 gains support for lossless audio formats for audiophile-level
experiences over USB wired headsets. You can query a USB device for its
preferred mixer attributes, register a listener for changes in preferred mixer
attributes, and configure mixer attributes using the
AudioMixerAttributes
class. This class represents the
format, such as channel mask, sample rate, and behavior of the audio mixer. The
class allows for audio to be sent directly, without mixing,
volume adjustment, or processing effects.
Năng suất và công cụ dành cho nhà phát triển
Trình quản lý thông tin xác thực
Android 14 thêm Trình quản lý thông tin xác thực làm API nền tảng, với khả năng hỗ trợ bổ sung cho các thiết bị Android 4.4 (API cấp 19) thông qua Thư viện Jetpack bằng Dịch vụ Google Play. Mục đích của Trình quản lý thông tin xác thực là giúp người dùng đăng nhập dễ dàng hơn bằng các API truy xuất và lưu trữ thông tin xác thực thông qua các trình cung cấp thông tin xác thực do người dùng định cấu hình. Trình quản lý thông tin xác thực hỗ trợ nhiều phương thức đăng nhập, bao gồm tên người dùng và mật khẩu, khoá truy cập và các giải pháp đăng nhập liên kết (chẳng hạn như Đăng nhập bằng Google) trong một API duy nhất.
Khẩu khoá truy cập mang lại nhiều lợi thế. Ví dụ: khoá truy cập được xây dựng dựa trên các tiêu chuẩn của ngành, có thể hoạt động trên nhiều hệ điều hành và hệ sinh thái trình duyệt, cũng như có thể được sử dụng với cả trang web và ứng dụng.
Để biết thêm thông tin, hãy xem tài liệu về Trình quản lý thông tin xác thực và khoá truy cập cũng như bài đăng trên blog về Trình quản lý thông tin xác thực và khoá truy cập.
Health Connect
Health Connect is an on-device repository for user health and fitness data. It allows users to share data between their favorite apps, with a single place to control what data they want to share with these apps.
On devices running Android versions prior to Android 14, Health Connect is available to download as an app on the Google Play store. Starting with Android 14, Health Connect is part of the platform and receives updates through Google Play system updates without requiring a separate download. With this, Health Connect can be updated frequently, and your apps can rely on Health Connect being available on devices running Android 14 or higher. Users can access Health Connect from the Settings in their device, with privacy controls integrated into the system settings.


Health Connect includes several new features in Android 14, such as exercise routes, allowing users to share a route of their workout which can be visualized on a map. A route is defined as a list of locations saved within a window of time, and your app can insert routes into exercise sessions, tying them together. To ensure that users have complete control over this sensitive data, users must allow sharing individual routes with other apps.
For more information, see the Health Connection documentation and the blogpost on What's new in Android Health.
Nội dung cập nhật OpenJDK 17
Android 14 continues the work of refreshing Android's core libraries to align with the features in the latest OpenJDK LTS releases, including both library updates and Java 17 language support for app and platform developers.
The following features and improvements are included:
- Updated approximately 300
java.base
classes to Java 17 support. - Text Blocks, which introduce multi-line string literals to the Java programming language.
- Pattern Matching for instanceof, which allows an object to
be treated as having a specific type in an
instanceof
without any additional variables. - Sealed classes, which allow you restrict which classes and interfaces can extend or implement them.
Thanks to Google Play system updates (Project Mainline), over 600 million devices are enabled to receive the latest Android Runtime (ART) updates that include these changes. This is part of our commitment to give apps a more consistent, secure environment across devices, and to deliver new features and capabilities to users independent of platform releases.
Java and OpenJDK are trademarks or registered trademarks of Oracle and/or its affiliates.
Những điểm cải tiến cho cửa hàng ứng dụng
Android 14 giới thiệu một số API PackageInstaller
cho phép cửa hàng ứng dụng cải thiện trải nghiệm người dùng.
Yêu cầu phê duyệt lượt cài đặt trước khi tải xuống
Có thể bạn phải yêu cầu người dùng phê duyệt việc cài đặt hoặc cập nhật ứng dụng.
Ví dụ: khi trình cài đặt sử dụng quyền REQUEST_INSTALL_PACKAGES
cố gắng cài đặt một ứng dụng mới. Trong các phiên bản Android trước, cửa hàng ứng dụng chỉ có thể yêu cầu người dùng phê duyệt sau khi các tệp APK được ghi vào phiên cài đặt còn phiên hoạt động thì được cam kết.
Kể từ Android 14, phương thức requestUserPreapproval()
sẽ cho phép trình cài đặt yêu cầu người dùng phê duyệt trước khi xác nhận phiên cài đặt. Điểm cải tiến này cho phép cửa hàng ứng dụng trì hoãn việc tải mọi tệp APK xuống cho đến khi người dùng phê duyệt quá trình cài đặt. Hơn nữa, sau khi người dùng phê duyệt việc cài đặt, cửa hàng ứng dụng có thể tải và cài đặt ứng dụng ở chế độ nền mà không làm gián đoạn người dùng.
Tuyên bố trách nhiệm đối với các bản cập nhật trong tương lai
Phương thức setRequestUpdateOwnership()
cho phép trình cài đặt cho hệ thống biết rằng sau này trình cài đặt dự định sẽ chịu trách nhiệm về các bản cập nhật của ứng dụng đang cài đặt. Tính năng này cho phép thực thi theo quyền sở hữu bản cập nhật, nghĩa là chỉ chủ sở hữu bản cập nhật mới được phép tự động cài đặt bản cập nhật cho ứng dụng. Việc thực thi theo quyền sở hữu bản cập nhật giúp đảm bảo rằng người dùng chỉ nhận được bản cập nhật từ cửa hàng ứng dụng theo đúng mong đợi.
Mọi trình cài đặt khác (bao gồm cả những trình cài đặt sử dụng quyền INSTALL_PACKAGES
) phải nhận được sự chấp thuận rõ ràng của người dùng để có thể cài đặt bản cập nhật. Nếu người dùng quyết định tiếp tục cập nhật từ một nguồn khác, thì quyền sở hữu bản cập nhật sẽ bị mất.
Cập nhật ứng dụng vào những thời điểm ít gây gián đoạn hơn
Các cửa hàng ứng dụng thường muốn tránh cập nhật một ứng dụng đang được sử dụng, vì việc này dẫn đến việc các quy trình đang chạy của ứng dụng bị dừng, có khả năng làm gián đoạn công việc mà người dùng đang thực hiện.
Kể từ Android 14, InstallConstraints
API sẽ giúp trình cài đặt có thể đảm bảo quá trình cập nhật ứng dụng diễn ra đúng lúc. Ví dụ: một cửa hàng ứng dụng có thể gọi phương thức commitSessionAfterInstallConstraintsAreMet()
để đảm bảo rằng bản cập nhật chỉ được cam kết khi người dùng không còn tương tác với ứng dụng có liên quan.
Cài đặt các phần phân tách không bắt buộc sao cho liền mạch
Nhờ tệp APK phân tách, nhiều tính năng của một ứng dụng có thể được phân phối trong các tệp APK riêng biệt, thay vì dưới dạng tệp APK nguyên khối. Tệp APK phân tách cho phép cửa hàng ứng dụng tối ưu hoá việc phân phối nhiều thành phần của ứng dụng. Ví dụ: có thể các cửa hàng ứng dụng sẽ tối ưu hoá dựa trên thuộc tính của thiết bị mục tiêu. PackageInstaller
API đã hỗ trợ các phần phân tách kể từ khi ra mắt trong API cấp 22.
Trong Android 14, phương thức setDontKillApp()
sẽ cho phép trình cài đặt cho biết rằng các quy trình đang chạy của ứng dụng sẽ không bị tắt khi các phần phân tách mới được cài đặt. Các cửa hàng ứng dụng có thể sử dụng tính năng này để cài đặt liền mạch những tính năng mới của một ứng dụng trong khi người dùng đang sử dụng ứng dụng đó.
Gói siêu dữ liệu ứng dụng
Starting in Android 14, the Android package installer lets you specify app metadata, such as data safety practices, to include on app store pages such as Google Play.
Phát hiện thời điểm người dùng chụp ảnh màn hình thiết bị
为了打造更加标准化的屏幕截图检测体验,Android 14 引入了可保护隐私的屏幕截图检测 API。借助此 API,应用可以按 activity 注册回调。如果用户在该 activity 可见时截取屏幕截图,系统会调用这些回调并通知用户。
Trải nghiệm người dùng
Các thao tác tuỳ chỉnh trên Trang chia sẻ nội dung và cách cải thiện thứ hạng
Android 14 updates the system sharesheet to support custom app actions and more informative preview results for users.
Add custom actions
With Android 14, your app can add custom actions to the system sharesheet it invokes.

Improve ranking of Direct Share targets
Android 14 uses more signals from apps to determine the ranking of the direct share targets to provide more helpful results for the user. To provide the most useful signal for ranking, follow the guidance for improving rankings of your Direct Share targets. Communication apps can also report shortcut usage for outgoing and incoming messages.

Hỗ trợ ảnh động tích hợp sẵn và ảnh động tuỳ chỉnh cho tính năng Xem trước thao tác quay lại
Android 13 在开发者选项背后引入了预测性“返回主屏幕”动画。在已启用开发者选项的受支持应用中使用时,滑回手势会显示动画,表明返回手势会使应用退回到主屏幕。
Android 14 包含针对“预测性返回”的多项改进和新指南:
- 您可设置
android:enableOnBackInvokedCallback=true
,以便为每个 activity 选择启用预测性返回系统动画,而不是为整个应用选择启用。 - 我们添加了新的系统动画,以配合 Android 13 中的“返回主屏幕”动画。新的系统动画是跨 activity 和跨任务的,您可在迁移到预测性返回后自动获得该动画。
- 我们为底部动作条、侧边动作条和搜索添加了新的 Material 组件动画。
- 我们制作了有关如何创建自定义应用内动画和转换的设计指南。
- 我们添加了许多新 API 来支持自定义的应用内转换动画:
在此 Android 14 预览版中,所有预测性返回功能都是位于开发者选项背后。请参阅与将您的应用迁移到预测性返回有关的开发者指南,以及与创建自定义应用内转换有关的开发者指南。
Ghi đè cho mỗi ứng dụng của nhà sản xuất thiết bị có màn hình lớn
借助按应用替换项,设备制造商可以更改应用在大屏设备上的行为。例如,FORCE_RESIZE_APP
替换项会指示系统调整应用大小以适应显示屏尺寸(避免进入尺寸兼容模式),即使在应用清单中设置了 resizeableActivity="false"
也是如此。
替换项旨在改善大屏设备上的用户体验。
借助新的清单属性,您可以为应用停用某些设备制造商替换项。
Ghi đè cho mỗi ứng dụng dành cho người dùng màn hình lớn
按应用替换项会更改应用在大屏设备上的行为。例如,无论应用的配置如何,OVERRIDE_MIN_ASPECT_RATIO_LARGE
设备制造商替换项都会将应用宽高比设置为 16:9。
借助 Android 14 QPR1,用户可以在大屏设备上通过新的设置菜单应用按应用替换项。
Chia sẻ màn hình ứng dụng
App screen sharing enables users to share an app window instead of the entire device screen during screen content recording.
With app screen sharing, the status bar, navigation bar, notifications, and other system UI elements are excluded from the shared display. Only the content of the selected app is shared.
App screen sharing improves productivity and privacy by enabling users to run multiple apps but limit content sharing to a single app.
Trả lời thông minh dựa trên LLM trong Gboard trên Pixel 8 Pro
On Pixel 8 Pro devices with the December Feature Drop, developers can try out higher-quality smart replies in Gboard powered by on-device Large Language Models (LLMs) running on Google Tensor.
This feature is available as a limited preview for US English in WhatsApp, Line, and KakaoTalk. It requires using a Pixel 8 Pro device with Gboard as your keyboard.
To try it out, first enable the feature in Settings > Developer Options > AiCore Settings > Enable Aicore Persistent.
Next, open a conversation in a supported app to see LLM-powered Smart Reply in Gboard's suggestion strip in response to incoming messages.
Đồ hoạ
Đường dẫn có thể truy vấn và nội suy
API Path
của Android là một cơ chế mạnh mẽ và linh hoạt để tạo và kết xuất đồ hoạ vectơ, với khả năng vẽ hoặc tô màu đường dẫn, tạo đường dẫn từ các đoạn thẳng hoặc đường cong bậc hai hoặc lập phương, thực hiện các thao tác boolean để có được hình dạng phức tạp hơn nữa hoặc đồng thời tất cả những hình dạng này. Một hạn chế là khả năng tìm hiểu nội dung thực sự trong đối tượng Đường dẫn; nội dung bên trong của đối tượng này được che đi trước các phương thức gọi sau khi tạo.
Để tạo Path
, hãy gọi các phương thức như moveTo()
, lineTo()
và cubicTo()
để thêm các phân đoạn đường dẫn. Nhưng không có cách nào để truy vấn đường dẫn về các phân đoạn, vì vậy bạn phải giữ lại thông tin đó tại thời điểm tạo.
Kể từ Android 14, bạn có thể truy vấn các đường dẫn để tìm hiểu nội dung bên trong đó.
Trước tiên, bạn cần sử dụng Path.getPathIterator
API để lấy đối tượng PathIterator
:
val path = Path().apply { moveTo(1.0f, 1.0f) lineTo(2.0f, 2.0f) close() } val pathIterator = path.pathIterator
Path path = new Path(); path.moveTo(1.0F, 1.0F); path.lineTo(2.0F, 2.0F); path.close(); PathIterator pathIterator = path.getPathIterator();
Tiếp theo, bạn có thể gọi PathIterator
để lặp lại từng phân đoạn, truy xuất tất cả dữ liệu cần thiết cho từng phân đoạn. Ví dụ này sử dụng các đối tượng PathIterator.Segment
để đóng gói dữ liệu cho bạn:
for (segment in pathIterator) { println("segment: ${segment.verb}, ${segment.points}") }
while (pathIterator.hasNext()) { PathIterator.Segment segment = pathIterator.next(); Log.i(LOG_TAG, "segment: " + segment.getVerb() + ", " + segment.getPoints()); }
PathIterator
cũng có phiên bản next()
không phân bổ, trong đó bạn có thể truyền một bộ đệm để lưu giữ dữ liệu điểm.
Một trong những trường hợp sử dụng quan trọng của việc truy vấn dữ liệu Path
là nội suy. Ví dụ: bạn có thể tạo hiệu ứng động (animate) hoặc biến đổi (morph) giữa hai đường dẫn riêng biệt. Để đơn giản hoá trường hợp sử dụng đó hơn nữa, Android 14 cũng bao gồm phương thức interpolate()
trên Path
. Giả sử hai đường dẫn này có cùng cấu trúc nội bộ, thì phương thức interpolate()
sẽ tạo một Path
mới với kết quả nội suy đó. Ví dụ này trả về một đường dẫn có hình dạng bằng một nửa (nội suy tuyến tính .5) giữa path
và otherPath
:
val interpolatedResult = Path() if (path.isInterpolatable(otherPath)) { path.interpolate(otherPath, .5f, interpolatedResult) }
Path interpolatedResult = new Path(); if (path.isInterpolatable(otherPath)) { path.interpolate(otherPath, 0.5F, interpolatedResult); }
Thư viện Jetpack graphics-path cũng kích hoạt các API tương tự cho các phiên bản Android trước đó.
Lưới tuỳ chỉnh với chương trình đổ bóng đỉnh và mảnh
Android has long supported drawing triangle meshes with custom shading, but the input mesh format has been limited to a few predefined attribute combinations. Android 14 adds support for custom meshes, which can be defined as triangles or triangle strips, and can, optionally, be indexed. These meshes are specified with custom attributes, vertex strides, varying, and vertex and fragment shaders written in AGSL.
The vertex shader defines the varyings, such as position and color, while the
fragment shader can optionally define the color for the pixel, typically by
using the varyings created by the vertex shader. If color is provided by the
fragment shader, it is then blended with the current Paint
color using the blend mode selected when
drawing the mesh. Uniforms can be passed
into the fragment and vertex shaders for additional flexibility.
Trình kết xuất vùng đệm phần cứng cho Canvas
协助使用 Android 的 Canvas
API 通过
硬件加速至 HardwareBuffer
、Android 14
引入了 HardwareBufferRenderer
。如果您的用例涉及通过 SurfaceControl
与系统合成器通信以实现低延迟绘制,此 API 特别有用。