सुविधाओं और एपीआई के बारे में खास जानकारी

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 the LocaleConfig 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 the res folders of your app modules and any library module dependencies to determine the locales to include in the LocaleConfig file.

  • Dynamic updates for an app's localeConfig: Use the setOverrideLocaleConfig() and getOverrideLocaleConfig() methods in LocaleManager 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 को जोड़ा गया है. इसकी मदद से, अपने ऐप्लिकेशन को फिर से बनाने के बिना, व्याकरण के हिसाब से लिंग के लिए सहायता जोड़ी जा सकती है.

जगह के हिसाब से प्राथमिकताएं

जगह के हिसाब से तापमान सेट करने की सुविधा की मदद से उपयोगकर्ता, तापमान की यूनिट को अपने हिसाब से बना सकते हैं. ऐसा करने के लिए, और क्रमांकन सिस्टम का इस्तेमाल किया जा सकता है. अमेरिका में रहने वाला यूरोपियन शायद तापमान की इकाइयां फ़ैरनहाइट के बजाय सेल्सियस में हों और ऐसे ऐप्लिकेशन जिनका इस्तेमाल सोमवार को हफ़्ते की शुरुआत के तौर पर किया जाता है, न कि अमेरिका की डिफ़ॉल्ट वैल्यू रविवार.

इन प्राथमिकताओं के लिए, Android के नए सेटिंग मेन्यू में उपयोगकर्ताओं को ऐप्लिकेशन की प्राथमिकताएं बदलने के लिए, एक ऐसी जगह मिलती है जहां उन्हें आसानी से ऐप्लिकेशन की प्राथमिकताएं दिखती हैं. ये प्राथमिकताएं, बैकअप लेने और उसे वापस लाने के बाद भी बनी रहती हैं. कई एपीआई और इंटेंट—जैसे getTemperatureUnit और getFirstDayOfWeek— अपने ऐप्लिकेशन को उपयोगकर्ता की पसंद के हिसाब से पढ़ने का ऐक्सेस दें, ताकि आपका ऐप्लिकेशन यह तय कर सके कि जानकारी दिखाता है. आप यह भी रजिस्टर कर सकते हैं कि BroadcastReceiver का मैंडेट चालू है ACTION_LOCALE_CHANGED का इस्तेमाल करें.

इन सेटिंग को खोजने के लिए, सेटिंग ऐप्लिकेशन खोलें और सिस्टम > भाषाएं और इनपुट > जगह के हिसाब से प्राथमिकताएं.

Android सिस्टम की सेटिंग में, जगह के हिसाब से प्राथमिकताएं सेट करने की स्क्रीन.
Android सिस्टम की सेटिंग में, जगह के हिसाब से तापमान के विकल्प.

सुलभता

फ़ॉन्ट को 200% तक नॉन-लीनियर तरीके से बड़ा करना

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

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

नॉन-लीनियर फ़ॉन्ट स्केलिंग की मदद से अपने ऐप्लिकेशन की जांच करना

अपने ऐप्लिकेशन की जांच करने के लिए, डिवाइस की सुलभता सेटिंग में जाकर, फ़ॉन्ट का सबसे बड़ा साइज़ चालू करें.

अगर टेक्स्ट का साइज़ तय करने के लिए, स्केल किए गए पिक्सल (sp) यूनिट का इस्तेमाल पहले से किया जा रहा है, तो ये अतिरिक्त विकल्प और स्केलिंग सुधार अपने-आप टेक्स्ट दिखाई देगा. हालांकि, आपको अभी भी फ़ॉन्ट साइज़ चालू (200%) किया जा सकता है, ताकि यह पक्का किया जा सके कि आपके ऐप्लिकेशन पर फ़ॉन्ट साइज़ लागू हों साथ ही, ये टूल बड़े साइज़ के फ़ॉन्ट में भी फ़िट हो सकते हैं. इससे, इस्तेमाल करने की सुविधा पर कोई असर नहीं पड़ता.

200% फ़ॉन्ट साइज़ चालू करने के लिए, यह तरीका अपनाएं:

  1. सेटिंग ऐप्लिकेशन खोलें और सुलभता > डिसप्ले का साइज़ और टेक्स्ट पर जाएं.
  2. फ़ॉन्ट का साइज़ विकल्प के लिए, प्लस (+) आइकॉन पर तब तक टैप करें, जब तक फ़ॉन्ट के सबसे बड़े साइज़ की सेटिंग चालू न हो जाए. इस सेक्शन में दी गई इमेज में यह तरीका दिखाया गया है.

टेक्स्ट के साइज़ के लिए, स्केल किए गए पिक्सल (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 इकाइयों में तय किया गया हो.

कैमरा और मीडिया

इमेज के लिए अल्ट्रा एचडीआर

An illustration of Standard Dynamic Range (SDR) versus High Dynamic Range (HDR) image quality.

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.

कैमरे के एक्सटेंशन में ज़ूम करने, फ़ोकस करने, पोस्टव्यू करने वगैरह की सुविधा

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:

इन-सेंसर ज़ूम

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

डेवलपर की प्रॉडक्टिविटी और टूल

Credential Manager

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.

Users can get started using Health Connect without a separate app download on devices running Android 14 or higher.
Users can control which apps have access to their health and fitness data through 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 अनुमति का इस्तेमाल करके नया ऐप्लिकेशन इंस्टॉल करने की कोशिश करता है. 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 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.

Screenshot of custom actions on the sharesheet.

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.

Direct Share row in the sharesheet, as shown by 1

प्रिडिक्टिव बैक के लिए, पहले से मौजूद और कस्टम ऐनिमेशन की सुविधा

वीडियो: प्रिडिक्टिव बैक ऐनिमेशन

Android 13 में, डेवलपर के विकल्प के पीछे, होम स्क्रीन पर वापस जाने के लिए प्रिडिक्टिव ऐनिमेशन की सुविधा जोड़ी गई है. अगर इस सुविधा का इस्तेमाल, डेवलपर के विकल्प के साथ काम करने वाले ऐप्लिकेशन में किया जाता है, तो पीछे की ओर स्वाइप करने पर एक ऐनिमेशन दिखता है. इससे पता चलता है कि पिछले पेज पर जाने के जेस्चर से, ऐप्लिकेशन से बाहर निकलकर होम स्क्रीन पर पहुंचा जा सकता है.

Android 14 में, अनुमानित तरीके से वापस जाने की सुविधा के लिए कई सुधार और नए दिशा-निर्देश शामिल किए गए हैं:

Android 14 के इस रिलीज़ में, अनुमानित बैक की सभी सुविधाएं, डेवलपर के विकल्प के तौर पर ही उपलब्ध हैं. अपने ऐप्लिकेशन को अनुमानित बैक ट्रांज़िशन पर माइग्रेट करने के लिए डेवलपर गाइड देखें. साथ ही, ऐप्लिकेशन में कस्टम ट्रांज़िशन बनाने के लिए डेवलपर गाइड देखें.

बड़ी स्क्रीन वाले डिवाइस बनाने वाली कंपनी के हिसाब से, हर ऐप्लिकेशन के लिए सेटिंग में बदलाव करने की सुविधा

Per-app overrides enable device manufacturers to change the behavior of apps on large screen devices. For example, the FORCE_RESIZE_APP override instructs the system to resize the app to fit display dimensions (avoiding size compatibility mode) even if resizeableActivity="false" is set in the app manifest.

Overrides are intended to improve the user experience on large screens.

New manifest properties enable you to disable some device manufacturer overrides for your app.

बड़ी स्क्रीन वाले डिवाइस पर, हर ऐप्लिकेशन के लिए उपयोगकर्ता की ओर से तय की गई सेटिंग

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.

ऐप्लिकेशन की स्क्रीन शेयर करने की सुविधा

ऐप्लिकेशन की स्क्रीन शेयर करने की सुविधा की मदद से, उपयोगकर्ता स्क्रीन कॉन्टेंट रिकॉर्ड करते समय, डिवाइस की पूरी स्क्रीन के बजाय, ऐप्लिकेशन की विंडो शेयर कर सकते हैं.

ऐप्लिकेशन की स्क्रीन शेयर करने की सुविधा का इस्तेमाल करने पर, स्टेटस बार, नेविगेशन बार, सूचनाएं, और सिस्टम के अन्य यूज़र इंटरफ़ेस (यूआई) एलिमेंट शेयर किए गए डिसप्ले में शामिल नहीं होते. सिर्फ़ चुने गए ऐप्लिकेशन का कॉन्टेंट शेयर किया जाता है.

ऐप्लिकेशन की स्क्रीन शेयर करने की सुविधा से, उपयोगकर्ताओं की प्रोडक्टिविटी और निजता बेहतर होती है. इसकी मदद से, वे एक से ज़्यादा ऐप्लिकेशन चला सकते हैं. हालांकि, कॉन्टेंट शेयर करने की सुविधा सिर्फ़ एक ऐप्लिकेशन के लिए उपलब्ध होती है.

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.

Gboard utilizes on-device LLMs to provide higher-quality smart replies.

ग्राफ़िक्स

पाथ के बारे में क्वेरी की जा सकती है और उन्हें इंटरपोलेट किया जा सकता है

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 रंग के साथ ब्लेंड किया जाता है. ज़्यादा सुविधाओं के लिए, यूनिफ़ॉर्म को फ़्रैगमेंट और वर्टिक्स शेडर में पास किया जा सकता है.

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.