Android 14 में, डेवलपर के लिए बेहतर सुविधाएं और एपीआई जोड़े गए हैं. इनसे आपको अपने ऐप्लिकेशन की सुविधाओं के बारे में जानने और उनसे जुड़े एपीआई का इस्तेमाल शुरू करने में मदद मिलती है.
जोड़े गए, बदले गए, और हटाए गए एपीआई की पूरी सूची के लिए, एपीआई के बीच अंतर की रिपोर्ट पढ़ें. जोड़े गए एपीआई के बारे में ज़्यादा जानने के लिए, Android API रेफ़रंस पर जाएं — Android 14 के लिए, एपीआई लेवल 34 में जोड़े गए एपीआई देखें. जिन जगहों पर प्लैटफ़ॉर्म में हुए बदलावों का आपके ऐप्लिकेशन पर असर पड़ सकता है उनके बारे में जानने के लिए, Android 14 को टारगेट करने वाले ऐप्लिकेशन और सभी ऐप्लिकेशन के लिए, Android 14 के काम करने के तरीके में हुए बदलावों के बारे में ज़रूर जानें.
इंटरनैशनलाइज़ेशन
हर ऐप्लिकेशन के हिसाब से पसंद की भाषा
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 अरब लोग लिंग के हिसाब से अलग-अलग तरह से इस्तेमाल होने वाली भाषाएं बोलते हैं. इन भाषाओं में, व्याकरण की कैटगरी, जैसे कि संज्ञा, क्रिया, विशेषण, और प्रीपोज़िशन, उन लोगों और ऑब्जेक्ट के लिंग के हिसाब से बदलते हैं जिनके बारे में बात की जा रही है. आम तौर पर, लैंगिक भेद वाली कई भाषाओं में, मर्दों के लिए इस्तेमाल होने वाले व्याकरण के लिंग को डिफ़ॉल्ट या सामान्य लिंग के तौर पर इस्तेमाल किया जाता है.
उपयोगकर्ताओं को गलत व्याकरण के हिसाब से संबोधित करने से, उनकी परफ़ॉर्मेंस और व्यवहार पर बुरा असर पड़ सकता है. जैसे, महिलाओं को पुल्लिग व्याकरण के हिसाब से संबोधित करना. इसके उलट, यूज़र इंटरफ़ेस (यूआई) में ऐसी भाषा का इस्तेमाल करने से, उपयोगकर्ता के व्याकरण के हिसाब से लिंग की जानकारी सही तरीके से दिखती है. इससे उपयोगकर्ता जुड़ाव बढ़ता है और उपयोगकर्ता को ज़्यादा पसंद के मुताबिक और स्वाभाविक अनुभव मिलता है.
लिंग के आधार पर बोली जाने वाली भाषाओं के लिए, उपयोगकर्ता के हिसाब से यूज़र इंटरफ़ेस (यूआई) बनाने में आपकी मदद करने के लिए, Android 14 में Grammatical Inflection API को जोड़ा गया है. इसकी मदद से, अपने ऐप्लिकेशन को फिर से बनाने के बिना, व्याकरण के हिसाब से लिंग के लिए सहायता जोड़ी जा सकती है.
जगह के हिसाब से प्राथमिकताएं
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% तक स्केल करने की सुविधा
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.
कैमरा और मीडिया
इमेज के लिए अल्ट्रा एचडीआर

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
क्लास का इस्तेमाल करके, मिक्सर एट्रिब्यूट को कॉन्फ़िगर किया जा सकता है. यह क्लास, चैनल मास्क, सैंपल रेट, और ऑडियो मिक्सर के व्यवहार जैसे फ़ॉर्मैट को दिखाती है. इस क्लास की मदद से, ऑडियो को सीधे भेजा जा सकता है. इसके लिए, ऑडियो को मिक्स करने, वॉल्यूम अडजस्ट करने या इफ़ेक्ट प्रोसेस करने की ज़रूरत नहीं होती.
डेवलपर की प्रोडक्टिविटी और टूल
Credential Manager
Android 14 将 Credential Manager 添加为平台 API,并通过使用 Google Play 服务的 Jetpack 库,向后额外支持 Android 4.4(API 级别 19)设备。Credential Manager 旨在通过 API 使用用户配置的凭据提供程序检索和存储凭据,让用户更轻松地登录。Credential Manager 在单个 API 中支持多种登录方法,包括用户名和密码、通行密钥和联合登录解决方案(如“使用 Google 账号登录”)。
通行密钥具有许多优势。例如,通行密钥是基于业界标准构建的,可在各种不同的操作系统和浏览器生态系统中使用,并且可用于网站和应用。
如需了解详情,请参阅 Credential Manager 和通行密钥文档以及介绍 Credential Manager 和通行密钥的博文。
Health Connect
Health Connect, उपयोगकर्ता की सेहत और फ़िटनेस से जुड़े डेटा का डिवाइस पर मौजूद डेटाबेस है. इसकी मदद से, उपयोगकर्ता अपने पसंदीदा ऐप्लिकेशन के बीच डेटा शेयर कर सकते हैं. साथ ही, एक ही जगह से यह कंट्रोल किया जा सकता है कि उन्हें इन ऐप्लिकेशन के साथ कौनसा डेटा शेयर करना है.
Android 14 से पहले के वर्शन वाले डिवाइसों पर, Health Connect को ऐप्लिकेशन के तौर पर डाउनलोड किया जा सकता है. इसके लिए, आपको Google Play Store पर जाना होगा. Android 14 से, Health Connect इस प्लैटफ़ॉर्म का हिस्सा है. साथ ही, इसे Google Play के सिस्टम अपडेट के ज़रिए अपडेट किया जाता है. इसके लिए, इसे अलग से डाउनलोड करने की ज़रूरत नहीं होती. इसकी मदद से, Health Connect को बार-बार अपडेट किया जा सकता है. साथ ही, आपके ऐप्लिकेशन इस बात पर भरोसा कर सकते हैं कि Health Connect, Android 14 या इसके बाद के वर्शन वाले डिवाइसों पर उपलब्ध है. उपयोगकर्ता अपने डिवाइस की सेटिंग में जाकर, Health Connect को ऐक्सेस कर सकते हैं. साथ ही, सिस्टम की सेटिंग में निजता सेटिंग भी इंटिग्रेट की गई हैं.


Android 14 में Health Connect में कई नई सुविधाएं शामिल हैं. जैसे, कसरत के लिए रास्ते की जानकारी. इससे उपयोगकर्ता, कसरत के लिए चुने गए रास्ते की जानकारी शेयर कर सकते हैं. इस जानकारी को मैप पर देखा जा सकता है. रास्ते को, किसी समयावधि में सेव की गई जगहों की सूची के तौर पर परिभाषित किया जाता है. आपका ऐप्लिकेशन, गतिविधि के सेशन में रास्ते जोड़ सकता है और उन्हें एक साथ जोड़ सकता है. यह पक्का करने के लिए कि उपयोगकर्ताओं के पास इस संवेदनशील डेटा पर पूरा कंट्रोल हो, उपयोगकर्ताओं को दूसरे ऐप्लिकेशन के साथ अलग-अलग रास्तों को शेयर करने की अनुमति देनी होगी.
ज़्यादा जानकारी के लिए, Health Connect का दस्तावेज़ और 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
एपीआई जोड़े गए हैं. इनकी मदद से, ऐप्लिकेशन स्टोर अपने उपयोगकर्ताओं के अनुभव को बेहतर बना सकते हैं.
डाउनलोड करने से पहले, इंस्टॉल करने की अनुमति का अनुरोध करना
किसी ऐप्लिकेशन को इंस्टॉल या अपडेट करने के लिए, उपयोगकर्ता की अनुमति लेनी पड़ सकती है.
उदाहरण के लिए, जब कोई इंस्टॉलर REQUEST_INSTALL_PACKAGES
अनुमति का इस्तेमाल करके नया ऐप्लिकेशन इंस्टॉल करने की कोशिश करता है. Android के पुराने वर्शन में, ऐप्लिकेशन स्टोर सिर्फ़ इसके बाद उपयोगकर्ता की अनुमति का अनुरोध कर सकते हैं, जब 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 में सिस्टम की शेयरशीट को अपडेट किया गया है, ताकि उपयोगकर्ताओं को कस्टम ऐप्लिकेशन ऐक्शन और ज़्यादा जानकारी देने वाली झलक के नतीजे दिखाए जा सकें.
कस्टम ऐक्शन जोड़ना
Android 14 में, आपका ऐप्लिकेशन सिस्टम शेयरशीट में कस्टम ऐक्शन जोड़ सकता है.

डायरेक्ट शेयर टारगेट की रैंकिंग को बेहतर बनाना
Android 14, डायरेक्ट शेयर टारगेट की रैंकिंग तय करने के लिए, ऐप्लिकेशन से ज़्यादा सिग्नल का इस्तेमाल करता है. इससे उपयोगकर्ता को ज़्यादा मददगार नतीजे मिलते हैं. रैंकिंग के लिए सबसे काम का सिग्नल देने के लिए, डायरेक्ट शेयर टारगेट की रैंकिंग को बेहतर बनाने के लिए दिए गए दिशा-निर्देशों का पालन करें. कम्यूनिकेशन ऐप्लिकेशन, भेजे और पाए गए मैसेज के लिए, शॉर्टकट के इस्तेमाल की रिपोर्ट भी कर सकते हैं.

प्रिडिक्टिव बैक के लिए, पहले से मौजूद और पसंद के मुताबिक बनाए गए ऐनिमेशन के साथ काम करना
Android 13 introduced the predictive back-to-home animation behind a developer option. When used in a supported app with the developer option enabled, swiping back shows an animation indicating that the back gesture exits the app back to the home screen.
Android 14 includes multiple improvements and new guidance for Predictive Back:
- You can set
android:enableOnBackInvokedCallback=true
to opt in to predictive back system animations per-Activity instead of for the entire app. - We've added new system animations to accompany the back-to-home animation from Android 13. The new system animations are cross-activity and cross-task, which you get automatically after migrating to Predictive Back.
- We've added new Material Component animations for Bottom sheets, Side sheets, and Search.
- We've created design guidance for creating custom in-app animations and transitions.
- We've added new APIs to support custom in-app transition animations:
handleOnBackStarted
,handleOnBackProgressed
,handleOnBackCancelled
in
OnBackPressedCallback
onBackStarted
,onBackProgressed
,onBackCancelled
in
OnBackAnimationCallback
- Use
overrideActivityTransition
instead ofoverridePendingTransition
for transitions that respond as the user swipes back.
With this Android 14 preview release, all features of Predictive Back remain behind a developer option. See the developer guide to migrate your app to predictive back, as well as the developer guide to creating custom in-app transitions.
बड़ी स्क्रीन वाले डिवाइस के मैन्युफ़ैक्चरर के हिसाब से, हर ऐप्लिकेशन के लिए बदलाव
हर ऐप्लिकेशन के लिए बदलाव करने की सुविधा की मदद से, डिवाइस बनाने वाली कंपनियां बड़ी स्क्रीन वाले डिवाइसों पर ऐप्लिकेशन के काम करने के तरीके में बदलाव कर सकती हैं. उदाहरण के लिए, FORCE_RESIZE_APP
ओवरराइड सिस्टम को डिसप्ले डाइमेंशन के हिसाब से ऐप्लिकेशन का साइज़ बदलने का निर्देश देता है, ताकि ऐप्लिकेशन के मेनिफ़ेस्ट में resizeableActivity="false"
सेट हो. हालांकि, साइज़ के साथ काम करने वाले मोड का इस्तेमाल नहीं किया जाता.
ओवरराइड का मकसद, बड़ी स्क्रीन पर उपयोगकर्ता अनुभव को बेहतर बनाना है.
नई मेनिफ़ेस्ट प्रॉपर्टी की मदद से, डिवाइस बनाने वाली कुछ कंपनियों के बदलावों को अपने ऐप्लिकेशन के लिए बंद किया जा सकता है.
हर ऐप्लिकेशन के लिए, बड़ी स्क्रीन पर उपयोगकर्ता के हिसाब से बदलाव
按应用替换项会更改应用在大屏设备上的行为。例如,无论应用的配置如何,OVERRIDE_MIN_ASPECT_RATIO_LARGE
设备制造商替换项都会将应用宽高比设置为 16:9。
借助 Android 14 QPR1,用户可以在大屏设备上通过新的设置菜单应用按应用替换项。
ऐप्लिकेशन की स्क्रीन शेयर करने की सुविधा
ऐप्लिकेशन की स्क्रीन शेयर करने की सुविधा की मदद से, उपयोगकर्ता स्क्रीन कॉन्टेंट रिकॉर्ड करते समय, डिवाइस की पूरी स्क्रीन के बजाय, ऐप्लिकेशन की विंडो शेयर कर सकते हैं.
ऐप्लिकेशन की स्क्रीन शेयर करने की सुविधा का इस्तेमाल करने पर, स्टेटस बार, नेविगेशन बार, सूचनाएं, और सिस्टम के अन्य यूज़र इंटरफ़ेस (यूआई) एलिमेंट शेयर किए गए डिसप्ले में शामिल नहीं होते. सिर्फ़ चुने गए ऐप्लिकेशन का कॉन्टेंट शेयर किया जाता है.
ऐप्लिकेशन की स्क्रीन शेयर करने की सुविधा से, उपयोगकर्ताओं की प्रोडक्टिविटी और निजता बेहतर होती है. इसकी मदद से, वे एक से ज़्यादा ऐप्लिकेशन चला सकते हैं. हालांकि, कॉन्टेंट शेयर करने की सुविधा सिर्फ़ एक ऐप्लिकेशन के लिए उपलब्ध होती है.
Pixel 8 Pro पर Gboard में एलएलएम की मदद से मिलने वाले स्मार्ट जवाब
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 का Path
एपीआई, वेक्टर ग्राफ़िक बनाने और रेंडर करने का एक बेहतरीन और सुविधाजनक तरीका है. इसमें पाथ को स्ट्रोक करने या भरने, लाइन सेगमेंट या क्वाड्रेटिक या क्यूबिक कर्व से पाथ बनाने, ज़्यादा जटिल आकार या इन सभी को एक साथ पाने के लिए बूलियन ऑपरेशन करने की सुविधा है. एक सीमा यह पता लगाने की क्षमता है कि असल में पाथ ऑब्जेक्ट में क्या है; बनाने के बाद ऑब्जेक्ट के अंदरूनी हिस्से, कॉलर को नहीं दिखते.
Path
बनाने के लिए, पाथ सेगमेंट जोड़ने के लिए, moveTo()
, lineTo()
, और cubicTo()
जैसे तरीकों को कॉल किया जाता है. हालांकि, उस पाथ से यह पूछने का कोई तरीका नहीं है कि सेगमेंट क्या हैं. इसलिए, आपको उस जानकारी को बनाने के समय सेव रखना होगा.
Android 14 में पाथ में क्या मौजूद है, यह जानने के लिए पाथ में क्वेरी की जा सकती है.
सबसे पहले, आपको Path.getPathIterator
एपीआई का इस्तेमाल करके, PathIterator
ऑब्जेक्ट हासिल करना होगा:
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();
इसके बाद, PathIterator
को कॉल करके, हर सेगमेंट के लिए ज़रूरी डेटा को एक-एक करके पाया जा सकता है. इस उदाहरण में, PathIterator.Segment
ऑब्जेक्ट का इस्तेमाल किया गया है, जो आपके लिए डेटा को पैकेज करता है:
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
में next()
का ऐसा वर्शन भी होता है जिसमें पॉइंट डेटा को सेव करने के लिए बफ़र को पास किया जा सकता है.
Path
डेटा के बारे में क्वेरी करने के इस्तेमाल के उदाहरणों में से एक है इंटरपोलेशन. उदाहरण के लिए, हो सकता है कि आप दो अलग-अलग पाथ के बीच ऐनिमेट (या मॉर्फ़) करना चाहें. इस्तेमाल के इस उदाहरण को और आसान बनाने के लिए, Android 14 में Path
पर interpolate()
तरीका भी शामिल किया गया है. यह मानते हुए कि दोनों पाथ का इंटरनल स्ट्रक्चर एक जैसा है, interpolate()
वाला तरीका इंटरपोलेट किए गए नतीजे के साथ एक नया Path
बनाता है. इस उदाहरण में, path
और otherPath
के बीच आधा (.5 का लीनियर इंटरपोलेशन) आकार वाला पाथ दिखता है:
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); }
Jetpack graphics-path लाइब्रेरी Android के पुराने वर्शन के लिए भी मिलते-जुलते एपीआई चालू करती है.
वर्टिक्स और फ़्रैगमेंट शेडर के साथ कस्टम मेश
Android में, कस्टम शेडिंग के साथ ट्राएंगल मेश बनाने की सुविधा लंबे समय से उपलब्ध है. हालांकि, इनपुट मेश फ़ॉर्मैट में पहले से तय किए गए कुछ एट्रिब्यूट कॉम्बिनेशन ही इस्तेमाल किए जा सकते हैं. Android 14 में कस्टम मेश के लिए सहायता जोड़ी गई है. इन्हें त्रिकोण या त्रिकोण के स्ट्रिप के तौर पर परिभाषित किया जा सकता है. साथ ही, इन्हें इंडेक्स भी किया जा सकता है. इन मेश को कस्टम एट्रिब्यूट, वर्टिक्स स्ट्राइड, वैरिएंट, और वर्टिक्स और फ़्रैगमेंट शेडर के साथ AGSL में लिखकर तय किया जाता है.
वर्टिक्स शेडर, पोज़िशन और रंग जैसे वैरिएशन तय करता है. वहीं, फ़्रेगमेंट शेडर, वैकल्पिक तौर पर पिक्सल के लिए रंग तय कर सकता है. आम तौर पर, ऐसा वर्टिक्स शेडर से बनाए गए वैरिएशन का इस्तेमाल करके किया जाता है. अगर कलर, फ़्रेगमेंट शेडर से दिया जाता है, तो इसे मेश बनाते समय चुने गए ब्लेंड मोड का इस्तेमाल करके, मौजूदा Paint
रंग के साथ ब्लेंड किया जाता है. ज़्यादा सुविधाओं के लिए, यूनिफ़ॉर्म को फ़्रैगमेंट और वर्टिक्स शेडर में पास किया जा सकता है.
Canvas के लिए हार्डवेयर बफ़र रेंडरर
To assist in using Android's Canvas
API to draw with
hardware acceleration into a HardwareBuffer
, Android 14
introduces HardwareBufferRenderer
. This API is
particularly useful when your use case involves communication with the system
compositor through SurfaceControl
for low-latency
drawing.