يقدّم نظام التشغيل Android 14 ميزات وواجهات برمجة تطبيقات رائعة للمطوّرين. تساعدك المعلومات التالية في التعرّف على ميزات تطبيقاتك والبدء في استخدام واجهات برمجة التطبيقات ذات الصلة.
للحصول على قائمة مفصّلة بواجهات برمجة التطبيقات التي تمت إضافتها وتعديلها وإزالتها، يُرجى قراءة تقرير الاختلافات في واجهات برمجة التطبيقات. للحصول على تفاصيل حول واجهات برمجة التطبيقات المضافة، يُرجى الانتقال إلى مرجع واجهات برمجة تطبيقات Android. بالنسبة إلى نظام التشغيل Android 14، ابحث عن واجهات برمجة التطبيقات التي تمت إضافتها في المستوى 34 لواجهة برمجة التطبيقات. للتعرّف على المجالات التي قد تؤثّر فيها تغييرات النظام الأساسي في تطبيقاتك، احرص على الاطّلاع على تغييرات السلوك في الإصدار 14 من نظام التشغيل Android للتطبيقات التي تستهدف الإصدار 14 من نظام التشغيل Android ولجميع التطبيقات.
التوافق مع أسواق عالمية
إعدادات اللغة المخصصة حسب التطبيقات
Android 14 expands on the per-app language features that were introduced in Android 13 (API level 33) with these additional capabilities:
Automatically generate an app's
localeConfig
: Starting with Android Studio Giraffe Canary 7 and AGP 8.1.0-alpha07, you can configure your app to support per-app language preferences automatically. Based on your project resources, the Android Gradle plugin generates theLocaleConfig
file and adds a reference to it in the final manifest file, so you no longer have to create or update the file manually. AGP uses the resources in theres
folders of your app modules and any library module dependencies to determine the locales to include in theLocaleConfig
file.Dynamic updates for an app's
localeConfig
: Use thesetOverrideLocaleConfig()
andgetOverrideLocaleConfig()
methods inLocaleManager
to dynamically update your app's list of supported languages in the device's system settings. Use this flexibility to customize the list of supported languages per region, run A/B experiments, or provide an updated list of locales if your app utilizes server-side pushes for localization.App language visibility for input method editors (IMEs): IMEs can utilize the
getApplicationLocales()
method to check the language of the current app and match the IME language to that language.
Grammatical Inflection API
3 billion people speak gendered languages: languages where grammatical categories—such as nouns, verbs, adjectives, and prepositions—inflect according to the gender of people and objects you talk to or about. Traditionally, many gendered languages use masculine grammatical gender as the default or generic gender.
Addressing users in the wrong grammatical gender, such as addressing women in masculine grammatical gender, can negatively impact their performance and attitude. In contrast, a UI with language that correctly reflects the user's grammatical gender can improve user engagement and provide a more personalized and natural-sounding user experience.
To help you build a user-centric UI for gendered languages, Android 14 introduces the Grammatical Inflection API, which lets you add support for grammatical gender without refactoring your app.
الإعدادات المفضّلة للمنطقة
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.


تسهيل الاستخدام
الضبط غير الخطي لحجم الخط بنسبة 200%
بدءًا من الإصدار Android 14، يتيح النظام زيادة حجم الخط بنسبة تصل إلى %200، ما يوفّر ضعاف البصر مع خيارات إمكانية الوصول الإضافية التي تتوافق مع إرشادات إتاحة المحتوى (WCAG):
لمنع تكبير عناصر النص الكبيرة على الشاشة بشكلٍ كبير جدًا، يطبّق النظام منحنى تكبير غير خطي. تعني استراتيجية تغيير الحجم هذه أنّ النص الكبير لا يتم تغيير حجمه بالمعدل نفسه الذي يتم به تغيير حجم النص الأصغر. يساعد الضبط غير الخطّي لحجم الخط في الحفاظ على التسلسل الهرمي النسبي بين العناصر ذات الأحجام المختلفة مع الحد من المشاكل المتعلّقة بتغيير حجم النص بشكل خطي بدرجات عالية (مثل اقتطاع النص أو صعوبة قراءته بسبب أحجام الشاشة الكبيرة جدًا).
اختبار تطبيقك باستخدام ميزة الضبط غير الخطّي لحجم الخط

إذا كنت تستخدم بالفعل وحدات البكسل المُعدَّل لتحديد حجم النص، خيارات إضافية وتحسينات التوسعة تلقائيًا على النص في تطبيقك. ومع ذلك، لا يزال يتعين عليك إجراء اختبار واجهة المستخدم بأقصى تم تفعيل حجم الخط (%200) لضمان استخدام التطبيق لأحجام الخط بشكل صحيح ويمكن أن تستوعب أحجام خطوط أكبر دون التأثير على سهولة الاستخدام.
لتفعيل حجم الخط بنسبة %200، اتّبِع الخطوات التالية:
- افتح تطبيق الإعدادات وانتقل إلى إمكانية الوصول > حجم العرض النص.
- بالنسبة إلى خيار حجم الخط، انقر على رمز علامة الجمع (+) إلى أن يتم ضبط الحدّ الأقصى للخط. تم تمكين إعداد الحجم، كما هو موضح في الصورة المصاحبة لهذا .
استخدام وحدات البكسل المعدَّلة (sp) لتحديد أحجام النصوص
احرص دائمًا على تحديد أحجام النص بوحدات sp. فعندما تطبيقك يستخدم وحدات وحدات بكسل قابلة للتوسّع، ويمكن لنظام Android تطبيق حجم النص المفضَّل للمستخدم وتوسيع نطاقه بشكل مناسب.
لا تستخدِم وحدات sp للمساحة الفارغة أو حدِّد ارتفاعات العرض بافتراض وجود مساحة فارغة ضمنية: مع تغيير حجم الخط غير الخطي، قد لا تكون سمات sp متناسبة، لذا قد لا يساوي 4sp + 20sp 24sp.
تحويل وحدات البكسل المقاسة (sp)
استخدِم TypedValue.applyDimension()
للتحويل من وحدات sp
إلى وحدات البكسل، واستخدِم TypedValue.deriveDimension()
لتحويل وحدات البكسل إلى وحدات sp. تطبِّق هذه الطرق منحنى التوسيع غير الخطي المناسب تلقائيًا.
تجنُّب معادلات الترميز الثابت باستخدام
Configuration.fontScale
أو
DisplayMetrics.scaledDensity
نظرًا لأن تكبير الخط
غير خطي، فلن يكون الحقل scaledDensity
دقيقًا. يجب استخدام الحقل fontScale
لأغراض إعلامية فقط لأنّه لم يعُد يتم
تصغير الخطوط باستخدام قيمة متّجهية واحدة.
استخدام وحدات sp مع lineHeight
تعريف android:lineHeight
دائمًا باستخدام وحدات sp بدلاً من ذلك
من dp، وبالتالي يتغير ارتفاع السطر مع النص. بخلاف ذلك، إذا كان النص
بوحدة sp ولكن lineHeight
بوحدة dp أو px، لن يتم تغيير حجمه وسيبدو مزدحمًا.
تصحح ميزة TextView lineHeight
تلقائيًا حتى يتم
يتم الحفاظ على النسب، ولكن فقط إذا كانت كل من textSize
وlineHeight
محددة بوحدات sp.
الكاميرا والوسائط
دقة HDR فائقة للصور

يتيح نظام التشغيل Android 14 استخدام صور النطاق العالي الديناميكية (HDR) التي تحتفظ بمزيد من المعلومات الواردة من أداة الاستشعار عند التقاط صورة، ما يتيح الحصول على ألوان زاهية ودرجة تباين أكبر. يستخدم نظام Android تنسيق Ultra HDR، وهو متوافق تمامًا مع صور JPEG القديمة، ما يسمح للتطبيقات بالعمل بسلاسة مع صور HDR وعرضها بنطاق ديناميكي عادي (SDR) عند الحاجة.
ويتم عرض هذه الصور في واجهة المستخدم بتنسيق HDR تلقائيًا من خلال إطار العمل
عندما يختار تطبيقك استخدام واجهة مستخدم بتنسيق HDR لـ "نافذة النشاط"، إما من خلال أحد إدخالات ملف البيان أو أثناء التشغيل من خلال استدعاء Window.setColorMode()
. يمكنك أيضًا التقاط صور ثابتة فائقة
التباين الديناميكي (HDR) المضغوطة على الأجهزة المتوافقة. من خلال استرداد المزيد من الألوان
من أداة الاستشعار، يمكن أن يكون التعديل في مرحلة ما بعد الإنتاج أكثر مرونة. يمكن استخدام رمز الترميز
Gainmap
المرتبط بالصور ذات النطاق العالي الديناميكية الفائق لعرضها
باستخدام OpenGL أو Vulkan.
التكبير/التصغير والتركيز والمعاينة بعد الالتقاط وغير ذلك في إضافات الكاميرا
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.
التكبير داخل المستشعر
When REQUEST_AVAILABLE_CAPABILITIES_STREAM_USE_CASE
in
CameraCharacteristics
contains
SCALER_AVAILABLE_STREAM_USE_CASES_CROPPED_RAW
, your app
can use advanced sensor capabilities to give a cropped RAW stream the same
pixels as the full field of view by using a CaptureRequest
with a RAW target that has stream use case set to
CameraMetadata.SCALER_AVAILABLE_STREAM_USE_CASES_CROPPED_RAW
.
By implementing the request override controls, the updated camera gives users
zoom control even before other camera controls are ready.
صوت عالي الدقة عبر USB
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.
إنتاجية المطوّرين وأدواتهم
مدير بيانات الاعتماد
Android 14 adds Credential Manager as a platform API, with additional support back to Android 4.4 (API level 19) devices through a Jetpack Library using Google Play services. Credential Manager aims to make sign-in easier for users with APIs that retrieve and store credentials with user-configured credential providers. Credential Manager supports multiple sign-in methods, including username and password, passkeys, and federated sign-in solutions (such as Sign-in with Google) in a single API.
Passkeys provide many advantages. For example, passkeys are built on industry standards, can work across different operating systems and browser ecosystems, and can be used with both websites and apps.
For more information, see the Credential Manager and passkeys documentation and the blogpost about Credential Manager and passkeys.
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.
تعديلات OpenJDK 17
يواصل نظام التشغيل Android 14 العمل على تحديث المكتبات الأساسية في Android لمواءمتها مع الميزات في أحدث إصدارات OpenJDK LTS، بما في ذلك تحديثات مكتبة ودعم لغة Java 17 لمطوّري التطبيقات والمنصات.
تشمل الميزات والتحسينات التالية:
- تم تعديل 300 فئة تقريبًا من فئات
java.base
لتتوافق مع Java 17. - كتل النصوص التي تُعرِض سلاسل نصية حرفية متعددة الأسطر في لغة البرمجة Java
- مطابقة الأنماط لـ instanceof، التي تسمح بالتعامل مع عنصر على أنّه يملك نوعًا معيّنًا في
instanceof
بدون أي متغيّرات إضافية - الفئات المُغلقة، التي تتيح لك فرض قيود على الفئات والواجهات التي يمكنها توسيع نطاقها أو تنفيذها
بفضل تحديثات نظام Google Play (Project Mainline)، تم تفعيل أكثر من 600 مليون جهاز لتلقّي آخر تحديثات Android Runtime (ART) التي تتضمن هذه التغييرات. يأتي ذلك في إطار التزامنا بتوفير بيئة أكثر اتساقًا وأمانًا للتطبيقات على جميع الأجهزة، وتقديم ميزات و إمكانات جديدة للمستخدمين بغض النظر عن إصدارات المنصة.
Java وOpenJDK هما علامتان تجاريتان مسجَّلتان لشركة Oracle و/أو شركائها التابعين.
تحسينات على متاجر التطبيقات
يقدّم نظام التشغيل Android 14 العديد من واجهات برمجة تطبيقات PackageInstaller
التي تسمح لمتاجر التطبيقات بتحسين تجربة المستخدمين.
طلب الموافقة على التثبيت قبل التنزيل
قد يتطلّب تثبيت تطبيق أو تحديثه موافقة المستخدم.
على سبيل المثال، عندما يحاول أحد تطبيقات التثبيت التي تستخدم إذن
REQUEST_INSTALL_PACKAGES
تثبيت
تطبيق جديد، لا يمكن لمتاجر التطبيقات طلب موافقة المستخدم إلا بعد كتابة حِزم APK في جلسة التثبيت وإتمام الجلسة.
اعتبارًا من Android 14، تتيح طريقة requestUserPreapproval()
للمُثبّتين طلب موافقة المستخدم قبل إكمال جلسة التثبيت. يتيح هذا التحسين لمتجر التطبيقات تأجيل تنزيل أي حِزم APK إلى
بعد أن يوافق المستخدم على التثبيت. بالإضافة إلى ذلك، بعد أن يمنح أحد المستخدمين موافقته على التثبيت، يمكن لمتجر التطبيقات تنزيل التطبيق وتثبيته في
الخلفية بدون مقاطعة المستخدم.
تأكيد مسؤولية التعديلات المستقبلية
تسمح طريقة setRequestUpdateOwnership()
للمثبّت
بإعلام النظام بأنّه سيتحمّل مسؤولية التحديثات المستقبلية
للتطبيق الذي يتم تثبيته. تتيح هذه الميزة فرض ملكية التحديث، ما يعني أنّه لا يُسمح إلا لمالك التحديث
بتثبيت التحديثات التلقائية للتطبيق. ويساعد فرض ملكية التحديث في
ضمان تلقّي المستخدمين للتحديثات من متجر التطبيقات المتوقّع فقط.
يجب أن يحصل أي مُثبِّت آخر، بما في ذلك مُثبِّتي التطبيقات الذين يستخدمون إذن
INSTALL_PACKAGES
، على موافقة صريحة من المستخدمين لتثبيت التحديث. إذا قرّر أحد المستخدِمين مواصلة تعديل
من مصدر آخر، ستتم فقدان ملكية التعديل.
تحديث التطبيقات في أوقات أقل إزعاجًا
تحاول متاجر التطبيقات عادةً تجنُّب تحديث تطبيق قيد الاستخدام بشكل نشط، لأنّ ذلك يؤدي إلى إيقاف العمليات الجارية للتطبيق، ما قد يؤدي بدوره إلى إيقاف ما كان يفعله المستخدم.
بدءًا من Android 14، تقدّم واجهة برمجة التطبيقات InstallConstraints
للمُثبّتين طريقة لضمان إجراء تحديثات التطبيقات في الوقت المناسب. على سبيل المثال، يمكن لمتجر تطبيقات استدعاء الأسلوب
commitSessionAfterInstallConstraintsAreMet()
لمحاولة التأكد من عدم التزام المستخدم بالتغييرات إلا عندما يتوقف عن التفاعل مع التطبيق المعني.
تثبيت الفواصل الاختيارية بسلاسة
باستخدام حِزم APK المجزّأة، يمكن توفير ميزات التطبيق في حِزم APK منفصلة، بدلاً من حزمة APK واحدة. تسمح ملفات APK المجزّأة لمتاجر التطبيقات بتحسين
عرض مكوّنات التطبيق المختلفة. على سبيل المثال، قد تعمل متاجر التطبيقات على تحسين
التطبيقات استنادًا إلى خصائص الجهاز المستهدَف. كانت واجهة برمجة التطبيقات
PackageInstaller
متوافقة مع عمليات التقسيم منذ
إدخالها في المستوى 22 من واجهة برمجة التطبيقات.
في نظام التشغيل Android 14، تسمح طريقة setDontKillApp()
لتطبيق
التثبيت بتحديد أنّه يجب عدم إنهاء عمليات التطبيق الجارية عند
تثبيت أقسام جديدة. يمكن لمتاجر التطبيقات استخدام هذه الميزة لتثبيت
ميزات جديدة للتطبيق بسلاسة أثناء استخدام المستخدم للتطبيق.
حِزم البيانات الوصفية للتطبيق
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.
رصد وقت أخذ المستخدمين لقطات شاشة للجهاز
To create a more standardized experience for detecting screenshots, Android 14 introduces a privacy-preserving screenshot detection API. This API lets apps register callbacks on a per-activity basis. These callbacks are invoked, and the user is notified, when the user takes a screenshot while that activity is visible.
تجربة المستخدم
الإجراءات المخصّصة في ورقة المشاركة والترتيب المحسّن
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.

إتاحة صور متحركة مضمّنة ومخصّصة لإيماءة "الرجوع التنبؤي"
قدّم نظام التشغيل Android 13 إيماءة الرجوع إلى الشاشة الرئيسية التنبؤية من خلال خيار مخصّص للمطوّرين. عند استخدامها في تطبيق متوافق مع تفعيل خيار المطوّر، يؤدي التمرير سريعًا للخلف إلى عرض صورة متحركة تشير إلى أنّ إيماءة الرجوع تؤدي إلى الخروج من التطبيق والرجوع إلى الشاشة الرئيسية.
يتضمّن Android 14 تحسينات متعدّدة وإرشادات جديدة بشأن ميزة "الرجوع التوقّعي":
- يمكنك ضبط
android:enableOnBackInvokedCallback=true
لتفعيل الصور المتحركة في النظام لإيماءة الرجوع إلى الخلف التنبؤية لكل نشاط بدلاً من تفعيلها للتطبيق بأكمله. - أضفنا صورًا متحركة جديدة للنظام لترافق الصورة المتحركة للرجوع إلى الشاشة الرئيسية من Android 13. إنّ الصور المتحركة الجديدة في النظام تعمل على جميع الأنشطة والمهام، ويتم عرضها تلقائيًا بعد نقل البيانات إلى ميزة "الرجوع التلقائي".
- أضفنا رسومًا متحركة جديدة لعناصر Material Design في الجدولَين المعروضَين في أسفل الشاشة والجدولَين الجانبيَين والبحث.
- لقد أنشأنا إرشادات تصميم لإنشاء مؤثرات مخصّصة للصور المتحركة والانتقالات داخل التطبيق.
- لقد أضفنا واجهات برمجة تطبيقات جديدة تتيح استخدام صور متحركة مخصّصة للانتقالات داخل التطبيق:
handleOnBackStarted
وhandleOnBackProgressed
وhandleOnBackCancelled
in
OnBackPressedCallback
onBackStarted
وonBackProgressed
وonBackCancelled
in
OnBackAnimationCallback
- استخدِم
overrideActivityTransition
بدلاً منoverridePendingTransition
للانتقالات التي تستجيب عندما يقلب المستخدم الشاشة للخلف.
في إصدار معاينة Android 14 هذا، تظل جميع ميزات "الترجيع التوقّعي" متاحة فقط من خلال خيار المطوّر. اطّلِع على دليل المطوّر لنقل بيانات تطبيقك إلى ميزة "الرجوع التوقّعي"، بالإضافة إلى دليل المطوّر لإنشاء التحولات المخصّصة داخل التطبيق.
عمليات إلغاء إعدادات التطبيق لكل جهاز من قِبل الشركة المصنّعة للأجهزة ذات الشاشات الكبيرة
تتيح عمليات إلغاء الإعدادات على مستوى التطبيق لصنّاع الأجهزة تغيير سلوك التطبيقات على الأجهزة ذات الشاشات الكبيرة. على سبيل المثال، عند إلغاء FORCE_RESIZE_APP
، يتم توجيه النظام لتغيير حجم التطبيق ليلائم أبعاد العرض (وتجنُّب وضع توافق الحجم) حتى في حال ضبط resizeableActivity="false"
في بيان التطبيق.
تهدف عمليات الإلغاء إلى تحسين تجربة المستخدم على الشاشات الكبيرة.
تتيح لك سمات البيان الجديدة إيقاف بعض عمليات إلغاء الشركة المصنّعة للجهاز لتطبيقك.
عمليات إلغاء الإعدادات التلقائية على الشاشات الكبيرة لكل تطبيق
تؤدي عمليات التجاوز لكل تطبيق إلى تغيير سلوك التطبيقات على الأجهزة ذات الشاشات الكبيرة. على سبيل المثال، يمكن للشركة المصنّعة للجهاز OVERRIDE_MIN_ASPECT_RATIO_LARGE
إلغاء الإعدادات وضبط نسبة عرض إلى ارتفاع التطبيق على 16:9 بغض النظر عن إعدادات التطبيق.
يتيح الإصدار 1 من الربع الثاني من العام 2021 من نظام التشغيل Android 14 للمستخدمين تطبيق عمليات إلغاء على مستوى كل تطبيق من خلال قائمة إعدادات جديدة على الأجهزة ذات الشاشات الكبيرة.
مشاركة شاشة التطبيق
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.
ميزة "الرد السريع" المستندة إلى نماذج اللغات الكبيرة في Gboard على هاتف 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.
الرسومات
يمكن البحث عن المسارات وتعديلها.
Android's Path
API is a powerful and flexible mechanism for
creating and rendering vector graphics, with the ability to stroke or fill a
path, construct a path from line segments or quadratic or cubic curves, perform
boolean operations to get even more complex shapes, or all of these
simultaneously. One limitation is the ability to find out what is actually in a
Path object; the internals of the object are opaque to callers after creation.
To create a Path
, you call methods such as
moveTo()
, lineTo()
, and
cubicTo()
to add path segments. But there has been no way to
ask that path what the segments are, so you must retain that information at
creation time.
Starting in Android 14, you can query paths to find out what's inside of them.
First, you need to get a PathIterator
object using the
Path.getPathIterator
API:
Kotlin
val path = Path().apply { moveTo(1.0f, 1.0f) lineTo(2.0f, 2.0f) close() } val pathIterator = path.pathIterator
Java
Path path = new Path(); path.moveTo(1.0F, 1.0F); path.lineTo(2.0F, 2.0F); path.close(); PathIterator pathIterator = path.getPathIterator();
Next, you can call PathIterator
to iterate through the segments
one by one, retrieving all of the necessary data for each segment. This example
uses PathIterator.Segment
objects, which packages up the data
for you:
Kotlin
for (segment in pathIterator) { println("segment: ${segment.verb}, ${segment.points}") }
Java
while (pathIterator.hasNext()) { PathIterator.Segment segment = pathIterator.next(); Log.i(LOG_TAG, "segment: " + segment.getVerb() + ", " + segment.getPoints()); }
PathIterator
also has a non-allocating version of next()
where you can pass
in a buffer to hold the point data.
One of the important use cases of querying Path
data is interpolation. For
example, you might want to animate (or morph) between two different paths. To
further simplify that use case, Android 14 also includes the
interpolate()
method on Path
. Assuming the two paths have
the same internal structure, the interpolate()
method creates a new Path
with that interpolated result. This example returns a path whose shape is
halfway (a linear interpolation of .5) between path
and otherPath
:
Kotlin
val interpolatedResult = Path() if (path.isInterpolatable(otherPath)) { path.interpolate(otherPath, .5f, interpolatedResult) }
Java
Path interpolatedResult = new Path(); if (path.isInterpolatable(otherPath)) { path.interpolate(otherPath, 0.5F, interpolatedResult); }
The Jetpack graphics-path library enables similar APIs for earlier versions of Android as well.
شبكات مخصّصة مع مظلّلات الرؤوس والتقسيمات
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.
أداة العرض باستخدام المخزن المؤقت للأجهزة في Canvas
للمساعدة في استخدام واجهة برمجة التطبيقات Canvas
في Android للرسم باستخدام
التسارع في الأجهزة في HardwareBuffer
، يوفّر الإصدار 14 من Android HardwareBufferRenderer
. واجهة برمجة التطبيقات هذه
عندما تشتمل حالة الاستخدام على التواصل مع النظام
المكون من خلال SurfaceControl
لوقت الاستجابة المنخفض
رسم.