Android 14 प्लैटफ़ॉर्म में कुछ ऐसे बदलाव किए गए हैं जिनका असर आपके ऐप्लिकेशन पर पड़ सकता है.
Android 14 पर चलने वाले सभी ऐप्लिकेशन पर, ये बदलाव लागू होते हैं. भले ही,
targetSdkVersion. आपको अपने ऐप्लिकेशन की जांच करनी चाहिए. इसके बाद, जहां लागू हो वहां इन सुविधाओं को ठीक से काम करने के लिए, ऐप्लिकेशन में ज़रूरत के मुताबिक बदलाव करना चाहिए.
Android 14 को टारगेट करने वाले ऐप्लिकेशन पर असर डालने वाले बदलावों की सूची भी ज़रूर देखें.
मुख्य फ़ंक्शन
सटीक समय वाले अलार्म शेड्यूल करने की अनुमति डिफ़ॉल्ट रूप से नहीं दी जाती
एग्ज़ैक्ट अलार्म, उपयोगकर्ता के हिसाब से सूचनाएं देने या ऐसी कार्रवाइयों के लिए होते हैं जिन्हें तय समय पर करना ज़रूरी होता है. Android 14 से, SCHEDULE_EXACT_ALARM अनुमति अब Android 13 और उसके बाद के वर्शन को टारगेट करने वाले ज़्यादातर नए इंस्टॉल किए गए ऐप्लिकेशन को पहले से नहीं दी जा रही है. यह अनुमति डिफ़ॉल्ट रूप से अस्वीकार कर दी जाती है.
ठीक समय पर अलार्म शेड्यूल करने की अनुमति में हुए बदलावों के बारे में ज़्यादा जानें.
ऐप्लिकेशन के कैश मेमोरी में सेव होने के दौरान, कॉन्टेक्स्ट के हिसाब से रजिस्टर की गई ब्रॉडकास्ट को लाइन में लगाया जाता है
On Android 14, the system can place context-registered broadcasts in a queue while the app is in the cached state. This is similar to the queuing behavior that Android 12 (API level 31) introduced for async binder transactions. Manifest-declared broadcasts aren't queued, and apps are removed from the cached state for broadcast delivery.
When the app leaves the cached state, such as returning to the foreground, the system delivers any queued broadcasts. Multiple instances of certain broadcasts might be merged into one broadcast. Depending on other factors, such as system health, apps might be removed from the cached state, and any previously queued broadcasts are delivered.
ऐप्लिकेशन सिर्फ़ अपनी बैकग्राउंड प्रोसेस बंद कर सकते हैं
Starting in Android 14, when your app calls killBackgroundProcesses(),
the API can kill only the background processes of your own app.
If you pass in the package name of another app, this method has no effect on that app's background processes, and the following message appears in Logcat:
Invalid packageName: com.example.anotherapp
Your app shouldn't use the killBackgroundProcesses() API or otherwise attempt
to influence the process lifecycle of other apps, even on older OS versions.
Android is designed to keep cached apps in the background and kill them
automatically when the system needs memory. If your app kills other apps
unnecessarily, it can reduce system performance and increase battery consumption
by requiring full restarts of those apps later, which takes significantly more
resources than resuming an existing cached app.
MTU को 517 पर सेट किया जाता है. यह MTU का अनुरोध करने वाला पहला GATT क्लाइंट होता है
Android 14 से, Android ब्लूटूथ स्टैक ब्लूटूथ कोर स्पेसिफ़िकेशन के वर्शन 5.2 का ज़्यादा सख्ती से पालन करता है. साथ ही, जब पहला GATT क्लाइंट BluetoothGatt#requestMtu(int) एपीआई का इस्तेमाल करके एमटीयू का अनुरोध करता है, तो BLE ATT एमटीयू को 517 बाइट तक का अनुरोध करता है. साथ ही, उस एसीएल कनेक्शन पर एमटीयू के सभी अनुरोधों को अनदेखा करता है.
इस बदलाव को ठीक करने और अपने ऐप्लिकेशन को ज़्यादा बेहतर बनाने के लिए, इन विकल्पों पर विचार करें:
- आपका पेरिफ़रल डिवाइस, Android डिवाइस के एमटीयू अनुरोध का जवाब, ऐसी सही वैल्यू के साथ देना चाहिए जिसे पेरिफ़रल डिवाइस इस्तेमाल कर सके. बातचीत के बाद तय की गई आखिरी वैल्यू, Android के अनुरोध की गई वैल्यू और रिमोट की दी गई वैल्यू (उदाहरण के लिए,
min(517, remoteMtu)) में से कम से कम वैल्यू होगी- इस समस्या को ठीक करने के लिए, सहायक डिवाइस के फ़र्मवेयर को अपडेट करना पड़ सकता है
- इसके अलावा, अपने GATT विशेषता के डेटा को लिखने की सीमा तय करें. यह सीमा, आपके डिवाइस के लिए काम करने वाली वैल्यू और एमटीयू में हुए बदलाव के बीच की कम से कम वैल्यू के आधार पर तय की जा सकती है
- आपको हेडर के लिए, इस्तेमाल किए जा सकने वाले साइज़ से 5 बाइट कम करने चाहिए
- उदाहरण के लिए:
arrayMaxLength = min(SUPPORTED_MTU, GATT_MAX_ATTR_LEN(517)) - 5
ऐप्लिकेशन को प्रतिबंधित स्टैंडबाय बकेट में रखने की नई वजह
Android 14 में, प्रतिबंधित स्टैंडबाय बकेट में ऐप्लिकेशन को डालने की एक नई वजह जोड़ी गई है.
ऐप्लिकेशन के जॉब, onStartJob,
onStopJob या onBind तरीके के टाइम आउट की वजह से, कई बार ANR गड़बड़ियां ट्रिगर करते हैं.
onStartJob और onStopJob में बदलावों के लिए, JobScheduler, कॉलबैक और नेटवर्क के व्यवहार को बेहतर बनाता है देखें.
यह ट्रैक करने के लिए कि ऐप्लिकेशन, पाबंदी वाली स्टैंडबाय बकेट में शामिल है या नहीं, हमारा सुझाव है कि आप जॉब के लागू होने पर UsageStatsManager.getAppStandbyBucket() या ऐप्लिकेशन के शुरू होने पर UsageStatsManager.queryEventsForSelf() एपीआई के साथ लॉग करें.
mlock का इस्तेमाल 64 केबी तक ही किया जा सकता है
Android 14 (एपीआई लेवल 34) और उसके बाद के वर्शन में, प्लैटफ़ॉर्म mlock() का इस्तेमाल करके, लॉक की जा सकने वाली ज़्यादा से ज़्यादा मेमोरी को हर प्रोसेस के लिए 64 केबी तक कम कर देता है. पिछले वर्शन में, हर प्रोसेस के लिए 64 एमबी की सीमा थी. इस पाबंदी से, ऐप्लिकेशन और सिस्टम में मेमोरी को बेहतर तरीके से मैनेज करने में मदद मिलती है. सभी डिवाइसों पर एक जैसा अनुभव देने के लिए, Android 14 में एक नया सीटीएस टेस्ट जोड़ा गया है. यह टेस्ट, उन डिवाइसों पर mlock() की नई सीमा के लिए किया जाता है जिन पर यह वर्शन काम करता है.
सिस्टम, कैश मेमोरी में सेव किए गए ऐप्लिकेशन के लिए संसाधनों के इस्तेमाल को लागू करता है
डिज़ाइन के हिसाब से, जब किसी ऐप्लिकेशन को बैकग्राउंड में भेजा जाता है और कोई दूसरा ऐप्लिकेशन प्रोसेस कॉम्पोनेंट नहीं चल रहा होता है, तो ऐप्लिकेशन की प्रोसेस कैश मेमोरी में सेव होती है. सिस्टम की मेमोरी कम होने की वजह से, इस तरह की ऐप्लिकेशन प्रोसेस को बंद किया जा सकता है. onStop() मेथड को कॉल करने और रिटर्न करने के बाद, Activity इंस्टेंस जो भी काम करते हैं वे भरोसेमंद नहीं होते. इसलिए, ऐसा करने से बचना चाहिए.
Android 14 में, इस डिज़ाइन को एक जैसा और लागू करने के लिए, कुछ बदलाव किए गए हैं. जब कोई ऐप्लिकेशन प्रोसेस कैश मेमोरी में सेव हो जाती है, तो बैकग्राउंड में काम करने की अनुमति नहीं दी जाती. ऐसा तब तक होता है, जब तक प्रोसेस का कोई कॉम्पोनेंट लाइफ़साइकल की चालू स्थिति में फिर से शामिल नहीं हो जाता.
फ़्रेमवर्क के साथ काम करने वाले लाइफ़साइकल एपीआई का इस्तेमाल करने वाले ऐप्लिकेशन पर, इन बदलावों का कोई असर नहीं पड़ेगा. जैसे, services, JobScheduler, और Jetpack WorkManager.
उपयोगकर्ता अनुभव
सूचनाओं को खारिज न कर पाने की सुविधा का इस्तेमाल करने वाले लोगों के अनुभव में बदलाव
If your app shows non-dismissable foreground notifications to users, Android 14 has changed the behavior to allow users to dismiss such notifications.
This change applies to apps that prevent users from dismissing foreground
notifications by setting Notification.FLAG_ONGOING_EVENT through
Notification.Builder#setOngoing(true) or
NotificationCompat.Builder#setOngoing(true). The behavior of
FLAG_ONGOING_EVENT has changed to make such notifications actually
dismissable by the user.
These kinds of notifications are still non-dismissable in the following conditions:
- When the phone is locked
- If the user selects a Clear all notification action (which helps with accidental dismissals)
Also, this new behavior doesn't apply to notifications in the following use cases:
CallStylenotifications- Device policy controller (DPC) and supporting packages for enterprise
- Media notifications
- The default Search Selector package
डेटा की सुरक्षा से जुड़ी जानकारी ज़्यादा आसानी से दिखती है
उपयोगकर्ता की निजता को बेहतर बनाने के लिए, Android 14 में उन जगहों की संख्या बढ़ाई गई है जहां सिस्टम, Play Console फ़ॉर्म में दी गई जानकारी दिखाता है. फ़िलहाल, उपयोगकर्ताओं को यह जानकारी Google Play में आपके ऐप्लिकेशन के स्टोर पेज पर, डेटा की सुरक्षा सेक्शन में दिख सकती है.
हमारा सुझाव है कि आप अपने ऐप्लिकेशन के लिए, जगह की जानकारी के डेटा को शेयर करने से जुड़ी नीतियों की समीक्षा करें. साथ ही, कुछ समय निकालकर अपने ऐप्लिकेशन के Google Play के डेटा की सुरक्षा वाले सेक्शन में, लागू होने वाले अपडेट करें.
Android 14 पर, डेटा की सुरक्षा से जुड़ी जानकारी ज़्यादा बेहतर तरीके से कैसे दिखती है, इस बारे में गाइड में ज़्यादा जानें.
सुलभता
फ़ॉन्ट को 200% तक नॉन-लीनियर तरीके से बड़ा करना
Starting in Android 14, the system supports font scaling up to 200%, providing users with additional accessibility options.
If you already use scaled pixels (sp) units to define text sizing, then this change probably won't have a high impact on your app. However, you should perform UI testing with the maximum font size enabled (200%) to ensure that your app can accommodate larger font sizes without impacting usability.
सुरक्षा
इंस्टॉल किए जा सकने वाले टारगेट एपीआई लेवल की ज़रूरी शर्तें
Starting with Android 14, apps with a
targetSdkVersion lower than 23
can't be installed. Requiring apps to meet these minimum target API level
requirements improves security and privacy for users.
Malware often targets older API levels in order to bypass security and privacy
protections that have been introduced in newer Android versions. For example,
some malware apps use a targetSdkVersion of 22 to avoid being subjected to the
runtime permission model introduced in 2015 by Android 6.0 Marshmallow (API
level 23). This Android 14 change makes it harder for malware to avoid security
and privacy improvements.
Attempting to install an app targeting a lower API level will result in an
installation failure, with the following message appearing in Logcat:
INSTALL_FAILED_DEPRECATED_SDK_VERSION: App package must target at least SDK version 23, but found 7
On devices upgrading to Android 14, any apps with a targetSdkVersion lower
than 23 will remain installed.
If you need to test an app targeting an older API level, use the following ADB command:
adb install --bypass-low-target-sdk-block FILENAME.apk
ऐसा हो सकता है कि मीडिया के मालिक के पैकेज के नाम छिपा दिए जाएं
मीडिया स्टोर में, OWNER_PACKAGE_NAME कॉलम के लिए क्वेरी की सुविधा उपलब्ध है. इससे, किसी खास मीडिया फ़ाइल को सेव करने वाले ऐप्लिकेशन के बारे में पता चलता है. Android
14 से, इस वैल्यू को तब तक छिपाया जाता है, जब तक कि इनमें से कम से कम एक शर्त पूरी न हो:
- जिस ऐप्लिकेशन ने मीडिया फ़ाइल को सेव किया है उसका पैकेज नेम, दूसरे ऐप्लिकेशन को हमेशा दिखता है.
मीडिया स्टोर से क्वेरी करने वाला ऐप्लिकेशन,
QUERY_ALL_PACKAGESअनुमति का अनुरोध करता है.
निजता के मकसद से, Android, पैकेज की उपलब्धता को कैसे फ़िल्टर करता है, इस बारे में ज़्यादा जानें.