Android 16 प्लैटफ़ॉर्म में, काम करने के तरीके में हुए बदलाव शामिल हैं. इनका असर आपके ऐप्लिकेशन पर पड़ सकता है.
काम करने के तरीके में हुए ये बदलाव, Android 16 पर चलने वाले सभी ऐप्लिकेशन पर लागू होते हैं. भले ही, targetSdkVersion
कुछ भी हो. आपको अपने ऐप्लिकेशन की जांच करनी चाहिए. इसके बाद, जहां ज़रूरी हो वहां इन बदलावों को लागू करने के लिए, ऐप्लिकेशन में बदलाव करना चाहिए.
Android 16 को टारगेट करने वाले ऐप्लिकेशन पर असर डालने वाले बदलावों की सूची भी ज़रूर देखें.
मुख्य फ़ंक्शन
Android 16 (एपीआई लेवल 36) में ये बदलाव शामिल हैं. इनसे Android सिस्टम की कई मुख्य क्षमताओं में बदलाव होता है या उन्हें बढ़ाया जाता है.
JobScheduler के कोटे को ऑप्टिमाइज़ करना
Android 16 से, हम सामान्य और तेज़ी से टास्क पूरा करने के लिए, रनटाइम कोटे में बदलाव कर रहे हैं. यह बदलाव इन बातों के आधार पर किया जा रहा है:
- ऐप्लिकेशन, ऐप्लिकेशन स्टैंडबाय बकेट की किस कैटगरी में है: Android 16 में, ऐक्टिव स्टैंडबाय बकेट के लिए रनटाइम कोटा लागू किया जाएगा.
- अगर ऐप्लिकेशन के टॉप स्टेट में होने के दौरान जॉब शुरू होती है: Android 16 में, अगर ऐप्लिकेशन के दिखने के दौरान जॉब शुरू होती है और ऐप्लिकेशन के न दिखने के बाद भी जारी रहती है, तो जॉब रनटाइम कोटे का पालन किया जाएगा.
- अगर फ़ोरग्राउंड सेवा चालू होने के दौरान जॉब को एक्ज़ीक्यूट किया जा रहा है: Android 16 में, फ़ोरग्राउंड सेवा के साथ-साथ एक्ज़ीक्यूट की जा रही जॉब, जॉब के रनटाइम कोटे का पालन करेंगी. अगर आपको उपयोगकर्ता की ओर से शुरू किए गए डेटा ट्रांसफ़र के लिए टास्क का इस्तेमाल करना है, तो उपयोगकर्ता की ओर से शुरू किए गए डेटा ट्रांसफ़र के टास्क का इस्तेमाल करें.
इस बदलाव का असर, WorkManager, JobScheduler, और DownloadManager का इस्तेमाल करके शेड्यूल किए गए टास्क पर पड़ता है. किसी जॉब को क्यों रोका गया, यह डीबग करने के लिए हमारा सुझाव है कि आप यह लॉग करें कि आपकी जॉब को WorkInfo.getStopReason()
को कॉल करके क्यों रोका गया (JobScheduler जॉब के लिए, JobParameters.getStopReason()
को कॉल करें).
आपके ऐप्लिकेशन की स्थिति से, इस्तेमाल किए जा सकने वाले संसाधनों पर क्या असर पड़ता है, इस बारे में जानने के लिए पावर मैनेजमेंट के संसाधनों की सीमाएं देखें. बैटरी के इस्तेमाल को ऑप्टिमाइज़ करने के सबसे सही तरीकों के बारे में ज़्यादा जानने के लिए, टास्क शेड्यूल करने वाले एपीआई के लिए बैटरी के इस्तेमाल को ऑप्टिमाइज़ करने से जुड़े दिशा-निर्देश देखें.
हमारा यह भी सुझाव है कि Android 16 में लॉन्च किए गए नए JobScheduler#getPendingJobReasonsHistory
एपीआई का इस्तेमाल करें. इससे आपको यह समझने में मदद मिलेगी कि कोई जॉब क्यों नहीं हुई.
टेस्ट करना
अपने ऐप्लिकेशन के व्यवहार की जांच करने के लिए, कुछ जॉब कोटा ऑप्टिमाइज़ेशन को तब तक के लिए बंद किया जा सकता है, जब तक ऐप्लिकेशन Android 16 डिवाइस पर चल रहा हो.
"सबसे ऊपर मौजूद स्थिति, नौकरी के रनटाइम कोटे का पालन करेगी" को लागू करने की सुविधा बंद करने के लिए, यह adb
कमांड चलाएं:
adb shell am compat enable OVERRIDE_QUOTA_ENFORCEMENT_TO_TOP_STARTED_JOBS APP_PACKAGE_NAME
"फ़ोरग्राउंड सेवा के साथ-साथ चल रही जॉब, जॉब के रनटाइम कोटा का पालन करेंगी" को लागू करने की सुविधा बंद करने के लिए, यह adb
कमांड चलाएं:
adb shell am compat enable OVERRIDE_QUOTA_ENFORCEMENT_TO_FGS_JOBS APP_PACKAGE_NAME
ऐप्लिकेशन स्टैंडबाय बकेट के कुछ व्यवहारों की जांच करने के लिए, अपने ऐप्लिकेशन के लिए ऐप्लिकेशन स्टैंडबाय बकेट सेट की जा सकती है. इसके लिए, यहां दिया गया adb
कमांड इस्तेमाल करें:
adb shell am set-standby-bucket APP_PACKAGE_NAME active|working_set|frequent|rare|restricted
आपका ऐप्लिकेशन, ऐप्लिकेशन स्टैंडबाय बकेट में किस लेवल पर है, यह जानने के लिए, यहां दिए गए adb
कमांड का इस्तेमाल करके, अपने ऐप्लिकेशन का ऐप्लिकेशन स्टैंडबाय बकेट पता लगाया जा सकता है:
adb shell am get-standby-bucket APP_PACKAGE_NAME
खाली नौकरियों के विज्ञापन बंद होने की वजह
जब जॉब से जुड़े JobParameters
ऑब्जेक्ट को गै़रबैज इकट्ठा करने की प्रोसेस के तहत हटा दिया जाता है, लेकिन जॉब पूरा होने का सिग्नल देने के लिए JobService#jobFinished(JobParameters,
boolean)
को कॉल नहीं किया जाता है, तो जॉब को छोड़ दिया जाता है. इससे पता चलता है कि ऐप्लिकेशन के बिना, शायद जॉब चल रहा हो और उसे फिर से शेड्यूल किया जा रहा हो.
JobScheduler पर निर्भर ऐप्लिकेशन, JobParameters
ऑब्जेक्ट का सटीक रेफ़रंस नहीं रखते. साथ ही, टाइम आउट होने पर अब STOP_REASON_TIMEOUT
के बजाय, STOP_REASON_TIMEOUT_ABANDONED
को नौकरी के रुकने की नई वजह के तौर पर इस्तेमाल किया जाएगा.
अगर 'नया काम बंद होने की वजह' बार-बार दिखती है, तो सिस्टम, जॉब की फ़्रीक्वेंसी कम करने के लिए कदम उठाएगा.
ऐप्लिकेशन को, 'कार्रवाई रोकने की नई वजह' का इस्तेमाल करके, अधूरे रह गए टास्क का पता लगाना चाहिए और उनकी संख्या कम करनी चाहिए.
अगर आपने WorkManager, AsyncTask या DownloadManager का इस्तेमाल किया है, तो आप पर इसका कोई असर नहीं पड़ेगा. ऐसा इसलिए, क्योंकि ये एपीआई आपके ऐप्लिकेशन की ओर से जॉब लाइफ़साइकल को मैनेज करते हैं.
JobInfo#setImportantWhileForeground को पूरी तरह से बंद किया जा रहा है
JobInfo.Builder#setImportantWhileForeground(boolean)
तरीका, शेड्यूलिंग ऐप्लिकेशन के फ़ोरग्राउंड में होने या बैकग्राउंड में काम करने से जुड़ी पाबंदियों से कुछ समय के लिए छूट मिलने पर, किसी टास्क की अहमियत दिखाता है.
Android 12 (एपीआई लेवल 31) के बाद, यह तरीका काम नहीं करता. Android 16 से, यह तरीका ठीक से काम नहीं करता. साथ ही, इस तरीके को कॉल करने पर, उसे अनदेखा कर दिया जाएगा.
यह सुविधा हटाने का फ़ैसला, JobInfo#isImportantWhileForeground()
पर भी लागू होता है. Android
16 में, अगर इस तरीके को कॉल किया जाता है, तो यह false
दिखाता है.
ब्रॉडकास्ट की प्राथमिकता के स्कोप को अब ग्लोबल नहीं किया जा सकता
Android apps are allowed to define priorities on broadcast receivers to control
the order in which the receivers receive and process the broadcast. For
manifest-declared receivers, apps can use the
android:priority
attribute to define the priority and for
context-registered receivers, apps can use the
IntentFilter#setPriority()
API to define the priority. When
a broadcast is sent, the system delivers it to receivers in order of their
priority, from highest to lowest.
In Android 16, broadcast delivery order using the android:priority
attribute
or IntentFilter#setPriority()
across different processes will not be
guaranteed. Broadcast priorities will only be respected within the same
application process rather than across all processes.
Also, broadcast priorities will be automatically confined to the range
(SYSTEM_LOW_PRIORITY
+ 1,
SYSTEM_HIGH_PRIORITY
- 1). Only system components will be
allowed to set SYSTEM_LOW_PRIORITY
, SYSTEM_HIGH_PRIORITY
as broadcast
priority.
Your app might be impacted if it does either of the following:
- Your application has declared multiple processes with the same broadcast intent, and has expectations around receiving those intents in a certain order based on the priority.
- Your application process interacts with other processes and has expectations around receiving a broadcast intent in a certain order.
If the processes need to coordinate with each other, they should communicate using other coordination channels.
एआरटी में किए गए आंतरिक बदलाव
Android 16 includes the latest updates to the Android Runtime (ART) that improve the Android Runtime's (ART's) performance and provide support for additional Java features. Through Google Play System updates, these improvements are also available to over a billion devices running Android 12 (API level 31) and higher.
As these changes are released, libraries and app code that rely on internal structures of ART might not work correctly on devices running Android 16, along with earlier Android versions that update the ART module through Google Play system updates.
Relying on internal structures (such as non-SDK interfaces) can always lead to compatibility problems, but it's particularly important to avoid relying on code (or libraries containing code) that leverages internal ART structures, since ART changes aren't tied to the platform version the device is running on and they go out to over a billion devices through Google Play system updates.
All developers should check whether their app is impacted by testing their apps thoroughly on Android 16. In addition, check the known issues to see if your app depends on any libraries that we've identified that rely on internal ART structures. If you do have app code or library dependencies that are affected, seek public API alternatives whenever possible and request public APIs for new use cases by creating a feature request in our issue tracker.
16 केबी वाले पेज साइज़ के साथ काम करने वाला मोड
Android 15 introduced support for 16 KB memory pages to optimize performance of the platform. Android 16 adds a compatibility mode, allowing some apps built for 4 KB memory pages to run on a device configured for 16 KB memory pages.
When your app is running on a device with Android 16 or higher, if Android
detects that your app has 4 KB aligned memory pages, it automatically uses
compatibility mode and display a notification dialog to the user. Setting the
android:pageSizeCompat
property in the AndroidManifest.xml
to enable the
backwards compatibility mode will prevent the display of the dialog when your
app launches. To use the android:pageSizeCompat
property, compile your app
using the Android 16 SDK.
For best performance, reliability, and stability, your app should still be 16 KB aligned. Check out our recent blog post on updating your apps to support 16 KB memory pages for more details.

उपयोगकर्ता अनुभव और सिस्टम यूज़र इंटरफ़ेस (यूआई)
Android 16 (एपीआई लेवल 36) में ये बदलाव शामिल हैं. इनका मकसद, उपयोगकर्ताओं को बेहतर और एक जैसा अनुभव देना है.
परेशान करने वाली सुलभता से जुड़ी सूचनाएँ पढ़कर सुनाने की सुविधा बंद की जा रही है
Android 16 में, सुलभता से जुड़ी सूचनाओं का इस्तेमाल नहीं किया जा सकता. इन सूचनाओं के लिए, announceForAccessibility
का इस्तेमाल किया जाता है या TYPE_ANNOUNCEMENT
सुलभता इवेंट भेजे जाते हैं. इनकी वजह से, TalkBack और Android के स्क्रीन रीडर का इस्तेमाल करने वाले लोगों को अलग-अलग अनुभव मिल सकते हैं. साथ ही, Android की सहायक तकनीकों की मदद से, लोगों की ज़्यादा से ज़्यादा ज़रूरतों को पूरा करने के लिए, इन विकल्पों का इस्तेमाल किया जा सकता है.
विकल्पों के उदाहरण:
- विंडो में बदलाव जैसे यूज़र इंटरफ़ेस (यूआई) में होने वाले अहम बदलावों के लिए,
Activity.setTitle(CharSequence)
औरsetAccessibilityPaneTitle(java.lang.CharSequence)
का इस्तेमाल करें. लिखने के लिए इस्तेमाल होने वाले टूल में,Modifier.semantics { paneTitle = "paneTitle" }
का इस्तेमाल करें - ज़रूरी यूज़र इंटरफ़ेस (यूआई) में हुए बदलावों के बारे में उपयोगकर्ता को बताने के लिए,
setAccessibilityLiveRegion(int)
का इस्तेमाल करें. लिखें में,Modifier.semantics { liveRegion = LiveRegionMode.[Polite|Assertive]}
का इस्तेमाल करें . इनका इस्तेमाल कम से कम करना चाहिए, क्योंकि हर बार व्यू अपडेट होने पर ये सूचनाएं जनरेट कर सकते हैं. - उपयोगकर्ताओं को गड़बड़ियों के बारे में सूचना देने के लिए, टाइप के
AccessibilityEvent
को भेजेंAccessibilityEvent#CONTENT_CHANGE_TYPE_ERROR
औरAccessibilityNodeInfo#setError(CharSequence)
सेट करें याTextView#setError(CharSequence)
का इस्तेमाल करें.
बंद किए गए announceForAccessibility
एपीआई के रेफ़रंस दस्तावेज़ में, सुझाए गए विकल्पों के बारे में ज़्यादा जानकारी शामिल है.
तीन बटन वाले नेविगेशन की सुविधा
Android 16 में, तीन बटन वाले नेविगेशन के लिए, ऐप्लिकेशन के पिछले पेज पर जाने की सुविधा जोड़ी गई है. हालांकि, यह सुविधा सिर्फ़ उन ऐप्लिकेशन के लिए उपलब्ध है जिन्हें पिछले पेज पर जाने की सुविधा के लिए सही तरीके से माइग्रेट किया गया हो. 'वापस जाएं' बटन को दबाकर रखने पर, प्रिडिक्टिव बैक ऐनिमेशन शुरू होता है. इससे आपको यह झलक मिलती है कि 'वापस जाएं' स्वाइप करने पर, आपको कहां ले जाया जाएगा.
यह सुविधा, सिस्टम के उन सभी हिस्सों पर लागू होती है जिनमें प्रिडिक्टिव बैक ऐनिमेशन काम करते हैं. इनमें सिस्टम ऐनिमेशन (होम स्क्रीन पर वापस जाने, एक टास्क से दूसरे टास्क पर जाने, और एक गतिविधि से दूसरी गतिविधि पर जाने) भी शामिल हैं.
थीम वाले ऐप्लिकेशन के आइकॉन अपने-आप जनरेट होने की सुविधा
Beginning with Android 16 QPR 2, Android automatically applies themes to app icons to create a cohesive home screen experience. This occurs if an app does not provide its own themed app icon. Apps can control the design of their themed app icon by including a monochrome layer within their adaptive icon and previewing what their app icon will look like in Android Studio.
डिवाइस के नाप या आकार
Android 16 (एपीआई लेवल 36) में, वर्चुअल डिवाइस के मालिकों के डिसप्ले पर प्रोजेक्ट किए जाने पर, ऐप्लिकेशन के लिए ये बदलाव शामिल हैं.
वर्चुअल डिवाइस के मालिक की ओर से किए गए बदलाव
A virtual device owner is a trusted or privileged app that creates and manages a virtual device. Virtual device owners run apps on a virtual device and then project the apps to the display of a remote device, such as a personal computer, virtual reality device, or car infotainment system. The virtual device owner is on a local device, such as a mobile phone.

Per-app overrides
On devices running Android 16 (API level 36), virtual device owners can override app settings on select virtual devices that the virtual device owners manage. For example, to improve app layout, a virtual device owner can ignore orientation, aspect ratio, and resizability restrictions when projecting apps onto an external display.
Common breaking changes
The Android 16 behavior might impact your app's UI on large screen form factors such as car displays or Chromebooks, especially layouts that were designed for small displays in portrait orientation. To learn how to make your app adaptive for all device form factors, see About adaptive layouts.
References
सुरक्षा
Android 16 (एपीआई लेवल 36) में ऐसे बदलाव किए गए हैं जिनसे सिस्टम की सुरक्षा को बढ़ावा मिलता है. इससे ऐप्लिकेशन और उपयोगकर्ताओं को नुकसान पहुंचाने वाले ऐप्लिकेशन से बचाने में मदद मिलती है.
इन्टेंट रीडायरेक्शन के हमलों से बचाने के लिए बेहतर सुरक्षा
Android 16 provides default security against general Intent
redirection
attacks, with minimum compatibility and developer changes required.
We are introducing by-default security hardening solutions to Intent
redirection exploits. In most cases, apps that use intents normally won't
experience any compatibility issues; we've gathered metrics throughout our
development process to monitor which apps might experience breakages.
Intent redirection in Android occurs when an attacker can partly or fully control the contents of an intent used to launch a new component in the context of a vulnerable app, while the victim app launches an untrusted sub-level intent in an extras field of an ("top-level") Intent. This can lead to the attacker app launching private components in the context of the victim app, triggering privileged actions, or gaining URI access to sensitive data, potentially leading to data theft and arbitrary code execution.
Opt out of Intent redirection handling
Android 16 introduces a new API that allows apps to opt out of launch security protections. This might be necessary in specific cases where the default security behavior interferes with legitimate app use cases.
For applications compiling against Android 16 (API level 36) SDK or higher
You can directly use the removeLaunchSecurityProtection()
method on the Intent
object.
val i = intent
val iSublevel: Intent? = i.getParcelableExtra("sub_intent")
iSublevel?.removeLaunchSecurityProtection() // Opt out from hardening
iSublevel?.let { startActivity(it) }
For applications compiling against Android 15 (API level 35) or lower
While not recommended, you can use reflection to access the
removeLaunchSecurityProtection()
method.
val i = intent
val iSublevel: Intent? = i.getParcelableExtra("sub_intent", Intent::class.java)
try {
val removeLaunchSecurityProtection = Intent::class.java.getDeclaredMethod("removeLaunchSecurityProtection")
removeLaunchSecurityProtection.invoke(iSublevel)
} catch (e: Exception) {
// Handle the exception, e.g., log it
} // Opt-out from the security hardening using reflection
iSublevel?.let { startActivity(it) }
साथी ऐप्लिकेशन को अब डिवाइस खोजने में लगने वाले समय के बारे में सूचना नहीं दी जाएगी
Android 16 introduces a new behavior during
companion device pairing flow to protect the user's location
privacy from malicious apps. All companion apps running on Android 16 are no
longer directly notified of discovery timeout using
RESULT_DISCOVERY_TIMEOUT
. Instead, the user is
notified of timeout events with a visual dialog. When the user dismisses
the dialog, the app is alerted of the association failure with
RESULT_USER_REJECTED
.
The search duration has also been extended from the original 20 seconds, and the device discovery can be stopped by the user at any point during the search. If at least one device was discovered within the first 20 seconds of starting the search, the CDM stops searching for additional devices.
कनेक्टिविटी
Android 16 (एपीआई लेवल 36) में, ब्लूटूथ स्टैक में ये बदलाव किए गए हैं, ताकि सहायक डिवाइसों के साथ कनेक्टिविटी को बेहतर बनाया जा सके.
बॉन्ड के नुकसान को बेहतर तरीके से मैनेज करना
Starting in Android 16, the Bluetooth stack has been updated to improve security and user experience when a remote bond loss is detected. Previously, the system would automatically remove the bond and initiate a new pairing process, which could lead to unintentional re-pairing. We have seen in many instances apps not taking care of the bond loss event in a consistent way.
To unify the experience, Android 16 improved the bond loss handling to the system. If a previously bonded Bluetooth device could not be authenticated upon reconnection, the system will disconnect the link, retain local bond information, and display a system dialog informing users of the bond loss and directing them to re-pair.