Android 14 में डेवलपर के लिए, शानदार सुविधाएं और एपीआई उपलब्ध हैं. इनसे आपको अपने ऐप्लिकेशन की सुविधाओं के बारे में जानने और उनसे जुड़े एपीआई का इस्तेमाल शुरू करने में मदद मिलती है.
जोड़े गए, बदले गए, और हटाए गए एपीआई की पूरी सूची के लिए, एपीआई के बीच अंतर की रिपोर्ट पढ़ें. जोड़े गए एपीआई के बारे में जानकारी के लिए Android API संदर्भ पर जाएं — Android 14, उन एपीआई को ढूंढें जिन्हें एपीआई लेवल 34 में जोड़ा गया था. क्षेत्रों के बारे में जानने के लिए इस प्लैटफ़ॉर्म में होने वाले बदलावों का असर आपके ऐप्लिकेशन पर पड़ सकता है. इसलिए, Android 14 और Android 14 को टारगेट करने वाले ऐप्लिकेशन और सभी ऐप्लिकेशन के काम करने के तरीके में हुए बदलाव.
इंटरनैशनलाइजेशन
हर ऐप्लिकेशन के हिसाब से पसंद की भाषा
Android 14 में, हर ऐप्लिकेशन के लिए भाषा से जुड़ी उन सुविधाओं को बेहतर बनाया गया है जिन्हें Android 13 (एपीआई लेवल 33) में लॉन्च किया गया था. साथ ही, इसमें ये नई सुविधाएं भी जोड़ी गई हैं:
ऐप्लिकेशन का
localeConfig
अपने-आप जनरेट होना: Android Studio Giraffe Canary 7 और AGP 8.1.0-alpha07 से, अपने ऐप्लिकेशन को हर ऐप्लिकेशन के लिए भाषा की सेटिंग के साथ काम करने के लिए कॉन्फ़िगर किया जा सकता है. आपके प्रोजेक्ट के संसाधनों के आधार पर, Android Gradle प्लग इनLocaleConfig
फ़ाइल जनरेट करता है और फ़ाइनल मेनिफ़ेस्ट फ़ाइल में इसका रेफ़रंस जोड़ता है. इससे, आपको फ़ाइल को मैन्युअल तरीके से बनाने या अपडेट करने की ज़रूरत नहीं पड़ती. AGP, आपके ऐप्लिकेशन मॉड्यूल केres
फ़ोल्डर और लाइब्रेरी मॉड्यूल की डिपेंडेंसी में मौजूद संसाधनों का इस्तेमाल करता है. इससे,LocaleConfig
फ़ाइल में शामिल करने के लिए स्थानीय भाषाओं का पता चलता है.ऐप्लिकेशन के
localeConfig
के लिए डाइनैमिक अपडेट:LocaleManager
में दिए गएsetOverrideLocaleConfig()
औरgetOverrideLocaleConfig()
तरीकों का इस्तेमाल करके, डिवाइस की सिस्टम सेटिंग में, ऐप्लिकेशन पर इस्तेमाल की जा सकने वाली भाषाओं की सूची को डाइनैमिक तौर पर अपडेट करें. इस सुविधा का इस्तेमाल करके, हर इलाके के हिसाब से इस्तेमाल की जा सकने वाली भाषाओं की सूची को पसंद के मुताबिक बनाएं, A/B प्रयोग चलाएं या स्थानीय भाषाओं की अपडेट की गई सूची दें. ऐसा तब करें, जब आपका ऐप्लिकेशन स्थानीय भाषा के लिए सर्वर-साइड पुश का इस्तेमाल करता हो.इनपुट के तरीके के संपादकों (आईएमई) के लिए ऐप्लिकेशन की भाषा दिखना: आईएमई,
getApplicationLocales()
के तरीके का इस्तेमाल करके, मौजूदा ऐप्लिकेशन की भाषा की जांच कर सकते हैं और आईएमई की भाषा को उस भाषा से मैच कर सकते हैं.
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.
लिंग के आधार पर बोली जाने वाली भाषाओं के लिए, उपयोगकर्ता के हिसाब से यूज़र इंटरफ़ेस (यूआई) बनाने में आपकी मदद करने के लिए, Android 14 में Grammatical Inflection API को जोड़ा गया है. इसकी मदद से, अपने ऐप्लिकेशन को फिर से बनाने के बिना, व्याकरण के हिसाब से लिंग के लिए सहायता जोड़ी जा सकती है.
जगह के हिसाब से प्राथमिकताएं
जगह के हिसाब से तापमान सेट करने की सुविधा की मदद से उपयोगकर्ता, तापमान की यूनिट को अपने हिसाब से बना सकते हैं. ऐसा करने के लिए, और क्रमांकन सिस्टम का इस्तेमाल किया जा सकता है. अमेरिका में रहने वाला यूरोपियन शायद तापमान की इकाइयां फ़ैरनहाइट के बजाय सेल्सियस में हों और ऐसे ऐप्लिकेशन जिनका इस्तेमाल सोमवार को हफ़्ते की शुरुआत के तौर पर किया जाता है, न कि अमेरिका की डिफ़ॉल्ट वैल्यू रविवार.
इन प्राथमिकताओं के लिए, Android के नए सेटिंग मेन्यू में उपयोगकर्ताओं को ऐप्लिकेशन की प्राथमिकताएं बदलने के लिए, एक ऐसी जगह मिलती है जहां उन्हें आसानी से ऐप्लिकेशन की प्राथमिकताएं दिखती हैं. ये प्राथमिकताएं, बैकअप लेने और उसे वापस लाने के बाद भी बनी रहती हैं. कई एपीआई और
इंटेंट—जैसे
getTemperatureUnit
और
getFirstDayOfWeek
—
अपने ऐप्लिकेशन को उपयोगकर्ता की पसंद के हिसाब से पढ़ने का ऐक्सेस दें, ताकि आपका ऐप्लिकेशन यह तय कर सके कि
जानकारी दिखाता है. आप यह भी रजिस्टर कर सकते हैं कि
BroadcastReceiver
का मैंडेट चालू है
ACTION_LOCALE_CHANGED
का इस्तेमाल करें.
इन सेटिंग को खोजने के लिए, सेटिंग ऐप्लिकेशन खोलें और सिस्टम > भाषाएं और इनपुट > जगह के हिसाब से प्राथमिकताएं.


सुलभता
फ़ॉन्ट को 200% तक स्केल करने की सुविधा
Android 14 से, सिस्टम में फ़ॉन्ट को 200% तक बड़ा किया जा सकता है. इससे कम दृष्टि वाले उपयोगकर्ताओं को, वेब कॉन्टेंट ऐक्सेसेबिलिटी से जुड़े दिशा-निर्देशों (डब्ल्यूसीएजी) के मुताबिक, सुलभता से जुड़े अन्य विकल्प मिलते हैं.
स्क्रीन पर मौजूद टेक्स्ट एलिमेंट का साइज़ बहुत बड़ा होने से रोकने के लिए, सिस्टम एक अरेखीय स्केलिंग कर्व लागू करता है. स्केलिंग की इस रणनीति का मतलब है कि बड़े टेक्स्ट छोटे टेक्स्ट की दर को स्केल नहीं करता. नॉनलाइनर फ़ॉन्ट स्केलिंग की मदद से, अलग-अलग साइज़ के एलिमेंट के बीच, अनुपात के हिसाब से हैरारकी बनाए रखने में मदद मिलती है. साथ ही, ज़्यादा डिग्री पर लीनियर टेक्स्ट स्केलिंग से जुड़ी समस्याओं को कम करने में भी मदद मिलती है. जैसे, टेक्स्ट का काटा जाना या बहुत बड़े डिसप्ले साइज़ की वजह से टेक्स्ट को पढ़ने में मुश्किल होना.
नॉन-लीनियर फ़ॉन्ट स्केलिंग की मदद से अपने ऐप्लिकेशन की जांच करना

अगर टेक्स्ट का साइज़ तय करने के लिए, स्केल किए गए पिक्सल (sp) यूनिट का इस्तेमाल पहले से किया जा रहा है, तो ये अतिरिक्त विकल्प और स्केलिंग सुधार अपने-आप टेक्स्ट दिखाई देगा. हालांकि, आपको अभी भी फ़ॉन्ट साइज़ चालू (200%) किया जा सकता है, ताकि यह पक्का किया जा सके कि आपके ऐप्लिकेशन पर फ़ॉन्ट साइज़ लागू हों साथ ही, ये टूल बड़े साइज़ के फ़ॉन्ट में भी फ़िट हो सकते हैं. इससे, इस्तेमाल करने की सुविधा पर कोई असर नहीं पड़ता.
200% फ़ॉन्ट साइज़ चालू करने के लिए, यह तरीका अपनाएं:
- सेटिंग ऐप्लिकेशन खोलें और सुलभता > डिसप्ले का साइज़ और टेक्स्ट पर जाएं.
- फ़ॉन्ट का साइज़ विकल्प के लिए, प्लस (+) आइकॉन पर तब तक टैप करें, जब तक फ़ॉन्ट के सबसे बड़े साइज़ की सेटिंग चालू न हो जाए. इस सेक्शन में दी गई इमेज में यह तरीका दिखाया गया है.
टेक्स्ट के साइज़ के लिए, स्केल किए गए पिक्सल (sp) यूनिट का इस्तेमाल करना
याद रखें कि हमेशा sp यूनिट में टेक्स्ट के साइज़ की जानकारी दें. टास्क कब शुरू होगा आपका ऐप्लिकेशन एसपी यूनिट का इस्तेमाल करता है, तो Android उपयोगकर्ता के टेक्स्ट का पसंदीदा साइज़ लागू कर सकता है और उसे ज़रूरत के हिसाब से स्केल करें.
पैडिंग के लिए sp यूनिट का इस्तेमाल न करें या पैडिंग के लिए व्यू की ऊंचाई तय न करें: नॉन-लाइनर फ़ॉन्ट स्केलिंग के साथ, हो सकता है कि sp डाइमेंशन का अनुपात न हो. इसलिए, हो सकता है कि 4sp + 20sp का योग 24sp न हो.
स्केल की गई पिक्सल (sp) इकाइयों को बदलना
sp यूनिट को पिक्सल में बदलने के लिए, TypedValue.applyDimension()
का इस्तेमाल करें. साथ ही, पिक्सल को sp में बदलने के लिए, TypedValue.deriveDimension()
का इस्तेमाल करें. ये तरीके, स्केलिंग के लिए सही नॉन-लाइनर कर्व को अपने-आप लागू करते हैं.
इनका इस्तेमाल करके हार्डकोडिंग समीकरण से बचें
Configuration.fontScale
या
DisplayMetrics.scaledDensity
. फ़ॉन्ट स्केलिंग, रेखीय नहीं होती. इसलिए, scaledDensity
फ़ील्ड अब सटीक नहीं है. fontScale
फ़ील्ड का इस्तेमाल सिर्फ़ जानकारी देने के लिए किया जाना चाहिए, क्योंकि फ़ॉन्ट अब एक स्केलर वैल्यू के साथ स्केल नहीं किए जाते.
लाइन की ऊंचाई के लिए एसपी इकाइयों का इस्तेमाल करें
android:lineHeight
की वैल्यू हमेशा डीपी के बजाय sp में दें, ताकि लाइन की ऊंचाई आपके टेक्स्ट के साथ स्केल हो सके. अगर आपका टेक्स्ट sp में है, लेकिन lineHeight
dp या px में है, तो टेक्स्ट का स्केल नहीं होता और वह छोटा दिखता है.
TextView, lineHeight
को अपने-आप ठीक करता है, ताकि आपके तय किए गए अनुपात बरकरार रहें. हालांकि, ऐसा सिर्फ़ तब होता है, जब textSize
और lineHeight
, दोनों को sp इकाइयों में तय किया गया हो.
कैमरा और मीडिया
इमेज के लिए अल्ट्रा एचडीआर

Android 14 में हाई डाइनैमिक रेंज (एचडीआर) इमेज की सुविधा जोड़ी गई है. इससे फ़ोटो खींचते समय, सेंसर से ज़्यादा जानकारी मिलती है. इससे फ़ोटो में ज़्यादा आकर्षक रंग और बेहतर कंट्रास्ट दिखता है. Android, अल्ट्रा एचडीआर फ़ॉर्मैट का इस्तेमाल करता है. यह फ़ॉर्मैट, JPEG इमेज के साथ पूरी तरह से काम करता है. इसकी मदद से, ऐप्लिकेशन आसानी से एचडीआर इमेज के साथ काम कर सकते हैं और ज़रूरत के हिसाब से उन्हें स्टैंडर्ड डाइनैमिक रेंज (एसडीआर) में दिखा सकते हैं.
जब आपका ऐप्लिकेशन अपनी गतिविधि विंडो के लिए एचडीआर यूआई का इस्तेमाल करने के लिए ऑप्ट-इन करता है, तो फ़्रेमवर्क इन इमेज को यूआई में एचडीआर में अपने-आप रेंडर कर देता है. ऐसा, मैनफ़ेस्ट एंट्री के ज़रिए या रनटाइम पर Window.setColorMode()
को कॉल करके किया जाता है. साथ ही, जिन डिवाइसों पर यह सुविधा काम करती है उन पर कंप्रेस की गई अल्ट्रा एचडी स्टिल इमेज भी कैप्चर की जा सकती हैं. सेंसर से ज़्यादा रंगों को रिकॉर्ड करने की सुविधा की मदद से, फ़ोटो में बदलाव करना आसान हो जाता है. अल्ट्रा एचडीआर इमेज से जुड़े 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.
नुकसान-रहित यूएसबी ऑडियो
Android 14 में, USB वायर वाले हेडसेट से बेहतर ऑडियो अनुभव पाने के लिए, लॉसलेस ऑडियो फ़ॉर्मैट का इस्तेमाल किया जा सकता है. यूएसबी डिवाइस के पसंदीदा मिक्सर एट्रिब्यूट के लिए क्वेरी की जा सकती है. साथ ही, पसंदीदा मिक्सर एट्रिब्यूट में होने वाले बदलावों के लिए, किसी लिसनर को रजिस्टर किया जा सकता है. इसके अलावा, AudioMixerAttributes
क्लास का इस्तेमाल करके, मिक्सर एट्रिब्यूट को कॉन्फ़िगर किया जा सकता है. यह क्लास, चैनल मास्क, सैंपल रेट, और ऑडियो मिक्सर के व्यवहार जैसे फ़ॉर्मैट को दिखाती है. इस क्लास की मदद से, ऑडियो को सीधे भेजा जा सकता है. इसके लिए, ऑडियो को मिक्स करने, वॉल्यूम अडजस्ट करने या इफ़ेक्ट प्रोसेस करने की ज़रूरत नहीं होती.
डेवलपर की उत्पादकता और टूल
क्रेडेंशियल मैनेजर
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 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.
ऐप्लिकेशन स्टोर के लिए सुधार
Android 14 引入了多个 PackageInstaller
API,可帮助应用商店改善其用户体验。
下载之前请求批准安装
安装或更新应用可能需要用户批准。例如,当使用 REQUEST_INSTALL_PACKAGES
权限的安装程序尝试安装新应用时。在之前的 Android 版本中,只有在将 APK 写入安装会话并且提交会话后,应用商店才能请求用户批准。
从 Android 14 开始,requestUserPreapproval()
方法可让安装程序在提交安装会话之前请求用户批准。此项改进可让应用商店将任何 APK 的下载操作推迟到用户批准安装之后。此外,用户批准安装后,应用商店可以在后台下载并安装应用,而不会干扰用户。
承担未来更新的责任
借助 setRequestUpdateOwnership()
方法,安装程序可以向系统表明它打算负责将被安装的应用未来的更新。此 capability 可实现更新所有权强制执行,即仅允许更新所有者为应用安装自动更新。更新所有权强制执行有助于确保用户仅收到来自预期应用商店的更新。
任何其他安装程序(包括使用 INSTALL_PACKAGES
权限的安装程序)都必须获得用户的明确批准,才能安装更新。如果用户决定继续从其他来源安装更新,则会失去更新所有权。
在干扰较少的时段更新应用
应用商店通常希望避免更新正在使用的应用,因为这会导致应用正在运行的进程被终止,而这可能会中断用户正在执行的操作。
从 Android 14 开始,InstallConstraints
API 让安装程序可以确保其应用更新在适当的时机进行。例如,应用商店可以调用 commitSessionAfterInstallConstraintsAreMet()
方法来确保仅在用户不再与相应应用互动时才进行更新。
无缝安装可选拆分
借助拆分 APK,应用的功能可以通过单独的 APK 文件提供,而不是以单体式 APK 的形式提供。借助拆分 APK,应用商店可以优化不同应用组件的提供。例如,应用商店可能会根据目标设备的属性进行优化。自在 API 级别 22 中引入以来,PackageInstaller
API 一直支持拆分。
在 Android 14 中,setDontKillApp()
方法可让安装程序指明在安装新的拆分项时应用的运行进程不应终止。应用商店可以使用此功能,在用户使用应用时无缝安装应用的新功能。
ऐप्लिकेशन मेटाडेटा बंडल
Android 14 में, Android पैकेज इंस्टॉलर की मदद से, ऐप्लिकेशन का मेटाडेटा दिया जा सकता है. जैसे, डेटा की सुरक्षा के तरीके. इससे, 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 更新了系统 Sharesheet,以便为用户提供自定义应用操作和信息更丰富的预览结果。
添加自定义操作
对于 Android 14,您的应用可以向其调用的系统 Sharesheet 添加自定义操作。

提高直接共享目标的排名
Android 14 根据来自应用的更多信号来确定直接共享目标的排名,以便为用户提供更实用的结果。为了提供最实用的排名信号,请遵循提高直接共享目标排名的准则。通讯应用还可以报告出站和入站消息的快捷方式使用情况。

प्रिडिक्टिव बैक के लिए, पहले से मौजूद और पसंद के मुताबिक बनाए गए ऐनिमेशन के साथ काम करना
Android 13 में, डेवलपर के विकल्प के पीछे, होम स्क्रीन पर वापस जाने के लिए प्रिडिक्टिव ऐनिमेशन की सुविधा जोड़ी गई है. अगर इस सुविधा का इस्तेमाल, डेवलपर के विकल्प के साथ काम करने वाले ऐप्लिकेशन में किया जाता है, तो पीछे की ओर स्वाइप करने पर एक ऐनिमेशन दिखता है. इससे पता चलता है कि पिछले पेज पर जाने के जेस्चर से, ऐप्लिकेशन से बाहर निकलकर होम स्क्रीन पर पहुंचा जा सकता है.
Android 14 में, अनुमानित तरीके से वापस जाने की सुविधा के लिए कई सुधार और नए दिशा-निर्देश शामिल किए गए हैं:
- पूरे ऐप्लिकेशन के बजाय, हर गतिविधि के लिए, प्रिडिक्टिव बैक सिस्टम ऐनिमेशन के लिए ऑप्ट इन करने के लिए,
android:enableOnBackInvokedCallback=true
को सेट किया जा सकता है. - हमने Android 13 में, होम स्क्रीन पर वापस जाने के ऐनिमेशन के साथ-साथ नए सिस्टम ऐनिमेशन जोड़े हैं. नए सिस्टम ऐनिमेशन, अलग-अलग गतिविधियों और टास्क के लिए होते हैं. ये प्रिडिक्टिव बैक पर माइग्रेट करने के बाद, अपने-आप चालू हो जाते हैं.
- हमने बॉटम शीट, साइड शीट, और खोज के लिए, मटीरियल कॉम्पोनेंट के नए ऐनिमेशन जोड़े हैं.
- हमने ऐप्लिकेशन में कस्टम ऐनिमेशन और ट्रांज़िशन बनाने के लिए, डिज़ाइन से जुड़े दिशा-निर्देश बनाए हैं.
- हमने कस्टम इन-ऐप्लिकेशन ट्रांज़िशन ऐनिमेशन के साथ काम करने के लिए, नए एपीआई जोड़े हैं:
handleOnBackStarted
,handleOnBackProgressed
,handleOnBackCancelled
in
OnBackPressedCallback
onBackStarted
,onBackProgressed
,onBackCancelled
in
OnBackAnimationCallback
- उपयोगकर्ता के वापस स्वाइप करने पर ट्रांज़िशन करने के लिए,
overridePendingTransition
के बजायoverrideActivityTransition
का इस्तेमाल करें.
Android 14 के इस रिलीज़ में, अनुमानित बैक की सभी सुविधाएं, डेवलपर के विकल्प के तौर पर ही उपलब्ध हैं. अपने ऐप्लिकेशन को अनुमानित बैक ट्रांज़िशन पर माइग्रेट करने के लिए डेवलपर गाइड देखें. साथ ही, ऐप्लिकेशन में कस्टम ट्रांज़िशन बनाने के लिए डेवलपर गाइड देखें.
हर ऐप्लिकेशन के लिए, बड़ी स्क्रीन वाले डिवाइस बनाने वाली कंपनी के ऐप्लिकेशन में बदलाव
हर ऐप्लिकेशन के लिए बदलाव करने की सुविधा की मदद से, डिवाइस बनाने वाली कंपनियां बड़ी स्क्रीन वाले डिवाइसों पर ऐप्लिकेशन के काम करने के तरीके में बदलाव कर सकती हैं. उदाहरण के लिए, FORCE_RESIZE_APP
ओवरराइड सिस्टम को डिसप्ले डाइमेंशन के हिसाब से ऐप्लिकेशन का साइज़ बदलने का निर्देश देता है, ताकि ऐप्लिकेशन के मेनिफ़ेस्ट में resizeableActivity="false"
सेट हो. हालांकि, साइज़ के साथ काम करने वाले मोड का इस्तेमाल नहीं किया जाता.
ओवरराइड का मकसद, बड़ी स्क्रीन पर उपयोगकर्ता अनुभव को बेहतर बनाना है.
नई मेनिफ़ेस्ट प्रॉपर्टी की मदद से, डिवाइस बनाने वाली कुछ कंपनियों के बदलावों को अपने ऐप्लिकेशन के लिए बंद किया जा सकता है.
हर ऐप्लिकेशन के लिए, बड़ी स्क्रीन पर उपयोगकर्ता के हिसाब से बदलाव
Per-app overrides change the behavior of apps on large screen devices. For example, the OVERRIDE_MIN_ASPECT_RATIO_LARGE
device manufacturer override sets the app aspect ratio to 16:9 regardless of the app's configuration.
Android 14 QPR1 enables users to apply per‑app overrides by means of a new settings menu on large screen devices.
ऐप्लिकेशन की स्क्रीन शेयर करें
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.
Pixel 8 Pro पर, Gboard में एलएलएम का इस्तेमाल करके स्मार्ट जवाब की सुविधा
Pixel 8 Pro डिवाइसों पर, दिसंबर में लॉन्च की गई सुविधाओं के साथ, डेवलपर Gboard में बेहतर क्वालिटी के स्मार्ट जवाबों को आज़मा सकते हैं. ये जवाब, Google Tensor पर चलने वाले डिवाइस पर मौजूद लार्ज लैंग्वेज मॉडल (एलएलएम) की मदद से जनरेट होते हैं.
यह सुविधा, WhatsApp, Line, और KakaoTalk में अमेरिकन इंग्लिश के लिए, सीमित तौर पर झलक के तौर पर उपलब्ध है. इसके लिए, Pixel 8 Pro डिवाइस का इस्तेमाल करना ज़रूरी है. साथ ही, Gboard को कीबोर्ड के तौर पर इस्तेमाल करना होगा.
इसे आज़माने के लिए, पहले सेटिंग > डेवलपर के लिए विकल्प > AICore की सेटिंग > 'AICore की सेटिंग हमेशा चालू रखें' को चालू करें.
इसके बाद, किसी ऐसे ऐप्लिकेशन में बातचीत खोलें जिसमें यह सुविधा काम करती है. इससे, आपको Gboard की सुझाव पट्टी में, आने वाले मैसेज के जवाब में एलएलएम की मदद से मिलने वाले स्मार्ट जवाब दिखेंगे.
ग्राफ़िक्स
पाथ के लिए क्वेरी की जा सकती है और उनमें इंटरपोलेशन किया जा सकता है
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 长期以来一直支持使用自定义着色绘制三角网格,但输入网格格式仅限于一些预定义的属性组合。Android 14 增加了对自定义网格的支持,可将其定义为三角形或三角形条,并且可以选择是否编入索引。这些网格是使用自定义属性、顶点步长、可变以及使用 AGSL 编写的顶点着色器和片段着色器指定的。
顶点着色器定义了位置和颜色等变量,而片段着色器可以选择为像素定义颜色,通常是使用顶点着色器创建的变量。如果片段着色器提供颜色,则系统会使用绘制网格时选择的混合模式将其与当前 Paint
颜色混合。Uniform 可以传递到片段着色器和顶点着色器,以提高灵活性。
कैनवस के लिए हार्डवेयर बफ़र रेंडरर
协助使用 Android 的 Canvas
API 通过
硬件加速至 HardwareBuffer
、Android 14
引入了 HardwareBufferRenderer
。如果您的用例涉及通过 SurfaceControl
与系统合成器通信以实现低延迟绘制,此 API 特别有用。