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.
ऐप्लिकेशन सिर्फ़ अपनी बैकग्राउंड प्रोसेस बंद कर सकते हैं
Android 14 और इसके बाद के वर्शन में, जब आपके ऐप्लिकेशन को killBackgroundProcesses() कॉल किया जाएगा,
एपीआई सिर्फ़ आपके ऐप्लिकेशन की बैकग्राउंड प्रोसेस को बंद कर सकता है.
अगर किसी दूसरे ऐप्लिकेशन का पैकेज नाम पास किया जाता है, तो इस तरीके का उस ऐप्लिकेशन की बैकग्राउंड प्रोसेस पर कोई असर नहीं पड़ता. साथ ही, Logcat में यह मैसेज दिखता है:
Invalid packageName: com.example.anotherapp
आपके ऐप्लिकेशन को killBackgroundProcesses() एपीआई का इस्तेमाल नहीं करना चाहिए. इसके अलावा, उसे अन्य ऐप्लिकेशन के प्रोसेस लाइफ़साइकल पर असर डालने की कोशिश भी नहीं करनी चाहिए. भले ही, वह किसी पुराने ऑपरेटिंग सिस्टम के वर्शन पर हो.
Android को इस तरह से डिज़ाइन किया गया है कि वह कैश मेमोरी में सेव किए गए ऐप्लिकेशन को बैकग्राउंड में रखता है. साथ ही, जब सिस्टम को मेमोरी की ज़रूरत पड़ती है, तब उन्हें अपने-आप बंद कर देता है. अगर आपका ऐप्लिकेशन अन्य ऐप्लिकेशन को ज़रूरत से ज़्यादा बंद करता है, तो इससे सिस्टम की परफ़ॉर्मेंस पर असर पड़ सकता है. साथ ही, बाद में उन ऐप्लिकेशन को फिर से शुरू करने की ज़रूरत पड़ने पर, बैटरी की खपत बढ़ सकती है. कैश मेमोरी में सेव किए गए किसी मौजूदा ऐप्लिकेशन को फिर से शुरू करने के मुकाबले, ऐसा करने में ज़्यादा संसाधनों की ज़रूरत पड़ती है.
MTU को 517 पर सेट किया जाता है. यह MTU का अनुरोध करने वाला पहला GATT क्लाइंट होता है
Starting from Android 14, the Android Bluetooth stack more strictly adheres to
Version 5.2 of the Bluetooth Core Specification and requests
the BLE ATT MTU to 517 bytes when the first GATT client requests an MTU using
the BluetoothGatt#requestMtu(int) API, and disregards all subsequent MTU
requests on that ACL connection.
To address this change and make your app more robust, consider the following options:
- Your peripheral device should respond to the Android device's MTU request
with a reasonable value that can be accommodated by the peripheral. The
final negotiated value will be a minimum of the Android requested value and
the remote provided value (for example,
min(517, remoteMtu))- Implementing this fix could require a firmware update for peripheral
- Alternatively, limit your GATT characteristic writes based on the minimum
between the known supported value of your peripheral and the received MTU
change
- A reminder that you should reduce 5 bytes from the supported size for the headers
- For example:
arrayMaxLength = min(SUPPORTED_MTU, GATT_MAX_ATTR_LEN(517)) - 5
ऐप्लिकेशन को प्रतिबंधित स्टैंडबाय बकेट में रखने की नई वजह
Android 14 introduces a new reason an app can be placed into the restricted standby bucket.
The app's jobs trigger ANR errors multiple times due to onStartJob,
onStopJob, or onBind method timeouts.
(See JobScheduler reinforces callback and network behavior for changes
to onStartJob and onStopJob.)
To track whether or not the app has entered the restricted standby bucket,
we recommend logging with the API UsageStatsManager.getAppStandbyBucket()
on job execution or UsageStatsManager.queryEventsForSelf() on app startup.
mlock का इस्तेमाल 64 केबी तक ही किया जा सकता है
In Android 14 (API level 34) and higher, the platform reduces the maximum memory
that can be locked using mlock() to 64 KB per process. In
previous versions, the limit was 64 MB per process. This restriction
promotes better memory management across apps and the system. To provide more
consistency across devices, Android 14 adds a new CTS test for the
new mlock() limit on compatible devices.
सिस्टम, कैश मेमोरी में सेव किए गए ऐप्लिकेशन के रिसॉर्स के इस्तेमाल को लागू करता है
By design, an app's process is in a cached state when it's moved to the
background and no other app process components are running. Such an app process
is subject to being killed due to system memory pressure. Any work that
Activity instances perform after the onStop() method has been called and
returned, while in this state, is unreliable and strongly discouraged.
Android 14 introduces consistency and enforcement to this design. Shortly after an app process enters a cached state, background work is disallowed, until a process component re-enters an active state of the lifecycle.
Apps that use typical framework-supported lifecycle APIs – such as
services, JobScheduler, and Jetpack WorkManager – shouldn't be
impacted by these changes.
उपयोगकर्ता अनुभव
सूचनाओं को खारिज न कर पाने की सुविधा का इस्तेमाल करने वाले लोगों के अनुभव में बदलाव
अगर आपका ऐप्लिकेशन, Android 14 पर दिखने वाली ऐसी सूचनाएं दिखाता है जिन्हें खारिज नहीं किया जा सकता ने उपयोगकर्ताओं को ऐसी सूचनाओं को खारिज करने की अनुमति देने के लिए व्यवहार में बदलाव किया है.
यह बदलाव उन ऐप्लिकेशन पर लागू होता है जो उपयोगकर्ताओं को फ़ोरग्राउंड खारिज करने से रोकते हैं
Notification.FLAG_ONGOING_EVENT को इसके ज़रिए सेट करने पर मिलने वाली सूचनाएँ
Notification.Builder#setOngoing(true) या
NotificationCompat.Builder#setOngoing(true). इसका व्यवहार
इस तरह की सूचनाओं को असल में दिखाने के लिए, FLAG_ONGOING_EVENT को बदल दिया गया है
जिसे उपयोगकर्ता खारिज कर सकता है.
नीचे दी गई स्थितियों में, इस तरह की सूचनाएं अब भी खारिज नहीं की जा सकतीं शर्तें:
- फ़ोन लॉक होने पर
- अगर उपयोगकर्ता, सूचना से जुड़ी सभी हटाएं कार्रवाई चुनता है (इससे गलती से खारिज हो जाना)
साथ ही, यह नई कार्रवाई इस्तेमाल के ये उदाहरण:
CallStyleसूचनाएं- एंटरप्राइज़ के लिए डिवाइस नीति नियंत्रक (डीपीसी) और सहायक पैकेज
- मीडिया से जुड़ी सूचनाएं
- डिफ़ॉल्ट खोज सिलेक्टर पैकेज
डेटा की सुरक्षा से जुड़ी जानकारी ज़्यादा आसानी से दिखती है
To enhance user privacy, Android 14 increases the number of places where the system shows the information you have declared in the Play Console form. Currently, users can view this information in the Data safety section on your app's listing in Google Play.
We encourage you to review your app's location data sharing policies and take a moment to make any applicable updates to your app's Google Play Data safety section.
Learn more in the guide about how data safety information is more visible on Android 14.
सुलभता
फ़ॉन्ट को 200% तक नॉन-लीनियर तरीके से बड़ा करना
Android 14 से, सिस्टम में फ़ॉन्ट को 200% तक बड़ा किया जा सकता है. इससे उपयोगकर्ताओं को सुलभता से जुड़ी अतिरिक्त सुविधाएं मिलती हैं.
अगर टेक्स्ट के साइज़ को तय करने के लिए, पहले से ही स्केल्ड पिक्सल (sp) यूनिट का इस्तेमाल किया जा रहा है, तो इस बदलाव का आपके ऐप्लिकेशन पर शायद ज़्यादा असर नहीं पड़ेगा. हालांकि, आपको ज़्यादा से ज़्यादा फ़ॉन्ट साइज़ (200%) चालू करके, यूज़र इंटरफ़ेस (यूआई) की टेस्टिंग करनी चाहिए. इससे यह पक्का किया जा सकेगा कि आपका ऐप्लिकेशन, इस्तेमाल में आसानी पर असर डाले बिना बड़े फ़ॉन्ट साइज़ को अडजस्ट कर सकता है.
सुरक्षा
इंस्टॉल किए जा सकने वाले टारगेट एपीआई लेवल की ज़रूरी शर्तें
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
ऐसा हो सकता है कि मीडिया के मालिक के पैकेज के नाम छिपा दिए जाएं
The media store supports queries for the OWNER_PACKAGE_NAME column, which
indicates the app that stored a particular media file. Starting in Android
14, this value is redacted unless at least one of the following conditions is
true:
- The app that stored the media file has a package name that is always visible to other apps.
The app that queries the media store requests the
QUERY_ALL_PACKAGESpermission.
Learn more about how Android filters package visibility for privacy purposes.