আচরণের পরিবর্তন: Android 15 বা উচ্চতরকে লক্ষ্য করে এমন অ্যাপ

পূর্ববর্তী রিলিজের মতো, Android 15-এও এমন আচরণগত পরিবর্তন রয়েছে যা আপনার অ্যাপকে প্রভাবিত করতে পারে। নিম্নলিখিত আচরণগত পরিবর্তনগুলি কেবলমাত্র Android 15 বা তার উচ্চতর সংস্করণগুলিকে লক্ষ্য করে এমন অ্যাপগুলিতে প্রযোজ্য। যদি আপনার অ্যাপটি Android 15 বা তার উচ্চতর সংস্করণগুলিকে লক্ষ্য করে থাকে, তাহলে প্রযোজ্য ক্ষেত্রে এই আচরণগুলিকে সঠিকভাবে সমর্থন করার জন্য আপনার অ্যাপটি পরিবর্তন করা উচিত।

আপনার অ্যাপের targetSdkVersion যাই হোক না কেন , Android 15 এ চলমান সমস্ত অ্যাপকে প্রভাবিত করে এমন আচরণগত পরিবর্তনের তালিকাটিও পর্যালোচনা করতে ভুলবেন না।

মূল কার্যকারিতা

অ্যান্ড্রয়েড ১৫ অ্যান্ড্রয়েড সিস্টেমের বিভিন্ন মূল ক্ষমতা পরিবর্তন বা প্রসারিত করে।

ফোরগ্রাউন্ড পরিষেবাগুলিতে পরিবর্তন

We are making the following changes to foreground services with Android 15.

Data sync foreground service timeout behavior

Android 15 introduces a new timeout behavior to dataSync for apps targeting Android 15 (API level 35) or higher. This behavior also applies to the new mediaProcessing foreground service type.

The system permits an app's dataSync services to run for a total of 6 hours in a 24-hour period, after which the system calls the running service's Service.onTimeout(int, int) method (introduced in Android 15). At this time, the service has a few seconds to call Service.stopSelf(). When Service.onTimeout() is called, the service is no longer considered a foreground service. If the service does not call Service.stopSelf(), the system throws an internal exception. The exception is logged in Logcat with the following message:

Fatal Exception: android.app.RemoteServiceException: "A foreground service of
type dataSync did not stop within its timeout: [component name]"

To avoid problems with this behavior change, you can do one or more of the following:

  1. Have your service implement the new Service.onTimeout(int, int) method. When your app receives the callback, make sure to call stopSelf() within a few seconds. (If you don't stop the app right away, the system generates a failure.)
  2. Make sure your app's dataSync services don't run for more than a total of 6 hours in any 24-hour period (unless the user interacts with the app, resetting the timer).
  3. Only start dataSync foreground services as a result of direct user interaction; since your app is in the foreground when the service starts, your service has the full six hours after the app goes to the background.
  4. Instead of using a dataSync foreground service, use an alternative API.

If your app's dataSync foreground services have run for 6 hours in the last 24, you cannot start another dataSync foreground service unless the user has brought your app to the foreground (which resets the timer). If you try to start another dataSync foreground service, the system throws ForegroundServiceStartNotAllowedException with an error message like "Time limit already exhausted for foreground service type dataSync".

Testing

To test your app's behavior, you can enable data sync timeouts even if your app is not targeting Android 15 (as long as the app is running on an Android 15 device). To enable timeouts, run the following adb command:

adb shell am compat enable FGS_INTRODUCE_TIME_LIMITS your-package-name

You can also adjust the timeout period, to make it easier to test how your app behaves when the limit is reached. To set a new timeout period, run the following adb command:

adb shell device_config put activity_manager data_sync_fgs_timeout_duration duration-in-milliseconds

New media processing foreground service type

Android 15 introduces a new foreground service type, mediaProcessing. This service type is appropriate for operations like transcoding media files. For example, a media app might download an audio file and need to convert it to a different format before playing it. You can use a mediaProcessing foreground service to make sure the conversion continues even while the app is in the background.

The system permits an app's mediaProcessing services to run for a total of 6 hours in a 24-hour period, after which the system calls the running service's Service.onTimeout(int, int) method (introduced in Android 15). At this time, the service has a few seconds to call Service.stopSelf(). If the service does not call Service.stopSelf(), the system throws an internal exception. The exception is logged in Logcat with the following message:

Fatal Exception: android.app.RemoteServiceException: "A foreground service of
type mediaProcessing did not stop within its timeout: [component name]"

To avoid having the exception, you can do one of the following:

  1. Have your service implement the new Service.onTimeout(int, int) method. When your app receives the callback, make sure to call stopSelf() within a few seconds. (If you don't stop the app right away, the system generates a failure.)
  2. Make sure your app's mediaProcessing services don't run for more than a total of 6 hours in any 24-hour period (unless the user interacts with the app, resetting the timer).
  3. Only start mediaProcessing foreground services as a result of direct user interaction; since your app is in the foreground when the service starts, your service has the full six hours after the app goes to the background.
  4. Instead of using a mediaProcessing foreground service, use an alternative API, like WorkManager.

If your app's mediaProcessing foreground services have run for 6 hours in the last 24, you cannot start another mediaProcessing foreground service unless the user has brought your app to the foreground (which resets the timer). If you try to start another mediaProcessing foreground service, the system throws ForegroundServiceStartNotAllowedException with an error message like "Time limit already exhausted for foreground service type mediaProcessing".

For more information about the mediaProcessing service type, see Changes to foreground service types for Android 15: Media processing.

Testing

To test your app's behavior, you can enable media processing timeouts even if your app is not targeting Android 15 (as long as the app is running on an Android 15 device). To enable timeouts, run the following adb command:

adb shell am compat enable FGS_INTRODUCE_TIME_LIMITS your-package-name

You can also adjust the timeout period, to make it easier to test how your app behaves when the limit is reached. To set a new timeout period, run the following adb command:

adb shell device_config put activity_manager media_processing_fgs_timeout_duration duration-in-milliseconds

Restrictions on BOOT_COMPLETED broadcast receivers launching foreground services

There are new restrictions on BOOT_COMPLETED broadcast receivers launching foreground services. BOOT_COMPLETED receivers are not allowed to launch the following types of foreground services:

If a BOOT_COMPLETED receiver tries to launch any of those types of foreground services, the system throws ForegroundServiceStartNotAllowedException.

Testing

To test your app's behavior, you can enable these new restrictions even if your app is not targeting Android 15 (as long as the app is running on an Android 15 device). Run the following adb command:

adb shell am compat enable FGS_BOOT_COMPLETED_RESTRICTIONS your-package-name

To send a BOOT_COMPLETED broadcast without restarting the device, run the following adb command:

adb shell am broadcast -a android.intent.action.BOOT_COMPLETED your-package-name

Restrictions on starting foreground services while an app holds the SYSTEM_ALERT_WINDOW permission

Previously, if an app held the SYSTEM_ALERT_WINDOW permission, it could launch a foreground service even if the app was currently in the background (as discussed in exemptions from background start restrictions).

If an app targets Android 15, this exemption is now narrower. The app now needs to have the SYSTEM_ALERT_WINDOW permission and also have a visible overlay window. That is, the app needs to first launch a TYPE_APPLICATION_OVERLAY window and the window needs to be visible before you start a foreground service.

If your app attempts to start a foreground service from the background without meeting these new requirements (and it does not have some other exemption), the system throws ForegroundServiceStartNotAllowedException.

If your app declares the SYSTEM_ALERT_WINDOW permission and launches foreground services from the background, it may be affected by this change. If your app gets a ForegroundServiceStartNotAllowedException, check your app's order of operations and make sure your app already has an active overlay window before it attempts to start a foreground service from the background. You can check if your overlay window is currently visible by calling View.getWindowVisibility(), or you can override View.onWindowVisibilityChanged() to get notified whenever the visibility changes.

Testing

To test your app's behavior, you can enable these new restrictions even if your app is not targeting Android 15 (as long as the app is running on an Android 15 device). To enable these new restrictions on starting foreground services from the background, run the following adb command:

adb shell am compat enable FGS_SAW_RESTRICTIONS your-package-name

অ্যাপগুলি কখন 'বিরক্ত করবেন না' মোডের বিশ্বব্যাপী অবস্থা পরিবর্তন করতে পারে তার পরিবর্তন

যে অ্যাপগুলি Android 15 (API লেভেল 35) এবং উচ্চতরকে টার্গেট করে তারা আর কোনও ডিভাইসে গ্লোবাল স্টেট বা Do Not Disturb (DND) এর নীতি পরিবর্তন করতে পারে না (হয় ব্যবহারকারী সেটিংস পরিবর্তন করে বা DND মোড বন্ধ করে)। পরিবর্তে, অ্যাপগুলিকে অবশ্যই একটি AutomaticZenRule অবদান রাখতে হবে, যা সিস্টেমটি বিদ্যমান সর্বাধিক-নিষেধমূলক-নীতি-জয় স্কিমের সাথে একটি বৈশ্বিক নীতিতে একত্রিত করে। বিদ্যমান API-এ কল যা পূর্বে গ্লোবাল স্টেটকে প্রভাবিত করেছিল ( setInterruptionFilter , setNotificationPolicy ) এর ফলে একটি অন্তর্নিহিত AutomaticZenRule তৈরি বা আপডেট হয়, যা সেই API কলগুলির কল-চক্রের উপর নির্ভর করে টগল করা এবং বন্ধ করা হয়।

মনে রাখবেন যে এই পরিবর্তনটি শুধুমাত্র পর্যবেক্ষণযোগ্য আচরণকে প্রভাবিত করে যদি অ্যাপটি setInterruptionFilter(INTERRUPTION_FILTER_ALL) কল করে এবং আশা করে যে কলটি একটি AutomaticZenRule নিষ্ক্রিয় করবে যা আগে তাদের মালিকদের দ্বারা সক্রিয় করা হয়েছিল৷

OpenJDK API পরিবর্তন

অ্যান্ড্রয়েড ১৫ সর্বশেষ ওপেনজেডিকে এলটিএস রিলিজের বৈশিষ্ট্যগুলির সাথে সামঞ্জস্যপূর্ণ করার জন্য অ্যান্ড্রয়েডের মূল লাইব্রেরিগুলিকে রিফ্রেশ করার কাজ চালিয়ে যাচ্ছে।

এই পরিবর্তনগুলির মধ্যে কিছু Android 15 (API লেভেল 35) লক্ষ্য করে তৈরি অ্যাপগুলির জন্য অ্যাপের সামঞ্জস্যতাকে প্রভাবিত করতে পারে:

  • স্ট্রিং ফর্ম্যাটিং API গুলিতে পরিবর্তন : নিম্নলিখিত String.format() এবং Formatter.format() API গুলি ব্যবহার করার সময় আর্গুমেন্ট সূচক, পতাকা, প্রস্থ এবং নির্ভুলতার বৈধতা এখন আরও কঠোর:

    উদাহরণস্বরূপ, যখন 0 এর একটি আর্গুমেন্ট সূচক ব্যবহার করা হয় ( %0 ফর্ম্যাট স্ট্রিংয়ে): তখন নিম্নলিখিত ব্যতিক্রমটি প্রয়োগ করা হয়:

    IllegalFormatArgumentIndexException: Illegal format argument index = 0
    

    এই ক্ষেত্রে, সমস্যাটি 1 ( %1 ফর্ম্যাট স্ট্রিংয়ে) এর একটি আর্গুমেন্ট সূচক ব্যবহার করে সমাধান করা যেতে পারে।

  • Arrays.asList(...).toArray() এর কম্পোনেন্ট টাইপে পরিবর্তন : Arrays.asList(...).toArray() ব্যবহার করার সময়, ফলাফলস্বরূপ অ্যারের কম্পোনেন্ট টাইপ এখন একটি Object হবে — অন্তর্নিহিত অ্যারের উপাদানের টাইপ নয়। তাই নিম্নলিখিত কোডটি একটি ClassCastException ছুঁড়ে দেয়:

    String[] elements = (String[]) Arrays.asList("one", "two").toArray();
    

    এই ক্ষেত্রে, ফলাফল অ্যারেতে String কম্পোনেন্ট টাইপ হিসেবে সংরক্ষণ করতে, আপনি Collection.toArray(Object[]) ব্যবহার করতে পারেন:

    String[] elements = Arrays.asList("two", "one").toArray(new String[0]);
    
  • ভাষা কোড পরিচালনায় পরিবর্তন : Locale API ব্যবহার করার সময়, হিব্রু, ইদ্দিশ এবং ইন্দোনেশিয়ান ভাষার ভাষা কোডগুলি আর তাদের অপ্রচলিত রূপে রূপান্তরিত হয় না (হিব্রু: iw , ইদ্দিশ: ji , এবং ইন্দোনেশিয়ান: in )। এই লোকেলগুলির একটির জন্য ভাষা কোড নির্দিষ্ট করার সময়, ISO 639-1 থেকে কোডগুলি ব্যবহার করুন (হিব্রু: he , ইদ্দিশ: yi , এবং ইন্দোনেশিয়ান: id )।

  • র‍্যান্ডম int সিকোয়েন্সে পরিবর্তন : https://bugs.openjdk.org/browse/JDK-8301574 এ করা পরিবর্তনগুলি অনুসরণ করে, নিম্নলিখিত Random.ints() পদ্ধতিগুলি এখন Random.nextInt() পদ্ধতিগুলির তুলনায় ভিন্ন সংখ্যার ক্রম প্রদান করে:

    সাধারণত, এই পরিবর্তনের ফলে অ্যাপ-ব্রেকিং আচরণ তৈরি হওয়া উচিত নয়, তবে আপনার কোডটি Random.ints() পদ্ধতি থেকে তৈরি ক্রমটি Random.nextInt() এর সাথে মিলবে বলে আশা করা উচিত নয়।

অ্যান্ড্রয়েড ১৫ (এপিআই লেভেল ৩৫) ব্যবহার করার জন্য আপনার অ্যাপের বিল্ড কনফিগারেশনে compileSdk আপডেট করার পরে নতুন SequencedCollection API আপনার অ্যাপের সামঞ্জস্যকে প্রভাবিত করতে পারে:

  • kotlin-stdlibMutableList.removeFirst() এবং MutableList.removeLast() এক্সটেনশন ফাংশনের সাথে সংঘর্ষ

    জাভাতে List টাইপটি Kotlin-এর MutableList টাইপের সাথে ম্যাপ করা হয়েছে। যেহেতু List.removeFirst() এবং List.removeLast() API গুলি Android 15 (API লেভেল 35) এ চালু করা হয়েছে, তাই Kotlin কম্পাইলার ফাংশন কলগুলি, উদাহরণস্বরূপ list.removeFirst() , kotlin-stdlib এর এক্সটেনশন ফাংশনের পরিবর্তে নতুন List API গুলিতে স্ট্যাটিকভাবে সমাধান করে।

    যদি কোনও অ্যাপকে compileSdk 35 এবং minSdk 34 বা তার নিচের ভার্সনে সেট করে পুনরায় কম্পাইল করা হয়, এবং তারপর অ্যাপটি Android ১৪ এবং তার নিচের ভার্সনে চালানো হয়, তাহলে একটি রানটাইম ত্রুটি দেখা দেয়:

    java.lang.NoSuchMethodError: No virtual method
    removeFirst()Ljava/lang/Object; in class Ljava/util/ArrayList;
    

    অ্যান্ড্রয়েড গ্রেডল প্লাগইনের বিদ্যমান NewApi লিন্ট বিকল্পটি এই নতুন এপিআই ব্যবহারগুলি ধরতে পারে।

    ./gradlew lint
    
    MainActivity.kt:41: Error: Call requires API level 35 (current min is 34): java.util.List#removeFirst [NewApi]
          list.removeFirst()
    

    রানটাইম এক্সেপশন এবং লিন্ট এরর ঠিক করার জন্য, Kotlin-এ removeFirst() এবং removeLast() ফাংশন কলগুলিকে যথাক্রমে removeAt(0) এবং removeAt(list.lastIndex) দিয়ে প্রতিস্থাপন করা যেতে পারে। আপনি যদি Android Studio Ladybug | 2024.1.3 বা উচ্চতর সংস্করণ ব্যবহার করেন, তাহলে এটি এই ত্রুটিগুলির জন্য একটি দ্রুত সমাধানের বিকল্পও প্রদান করে।

    যদি লিন্ট অপশনটি নিষ্ক্রিয় করা থাকে, তাহলে @SuppressLint("NewApi") এবং lintOptions { disable 'NewApi' } অপসারণ করার কথা বিবেচনা করুন।

  • জাভাতে অন্যান্য পদ্ধতির সাথে সংঘর্ষ

    বিদ্যমান প্রকারগুলিতে নতুন পদ্ধতি যুক্ত করা হয়েছে, উদাহরণস্বরূপ, List এবং Deque । এই নতুন পদ্ধতিগুলি অন্যান্য ইন্টারফেস এবং ক্লাসে একই নাম এবং আর্গুমেন্ট ধরণের পদ্ধতিগুলির সাথে সামঞ্জস্যপূর্ণ নাও হতে পারে। কোনও পদ্ধতির স্বাক্ষরের সাথে অসঙ্গতির সংঘর্ষের ক্ষেত্রে, javac কম্পাইলার একটি বিল্ড-টাইম ত্রুটি আউটপুট করে। উদাহরণস্বরূপ:

    উদাহরণ ত্রুটি ১:

    javac MyList.java
    
    MyList.java:135: error: removeLast() in MyList cannot implement removeLast() in List
      public void removeLast() {
                  ^
      return type void is not compatible with Object
      where E is a type-variable:
        E extends Object declared in interface List
    

    উদাহরণ ত্রুটি ২:

    javac MyList.java
    
    MyList.java:7: error: types Deque<Object> and List<Object> are incompatible;
    public class MyList implements  List<Object>, Deque<Object> {
      both define reversed(), but with unrelated return types
    1 error
    

    উদাহরণ ত্রুটি ৩:

    javac MyList.java
    
    MyList.java:43: error: types List<E#1> and MyInterface<E#2> are incompatible;
    public static class MyList implements List<Object>, MyInterface<Object> {
      class MyList inherits unrelated defaults for getFirst() from types List and MyInterface
      where E#1,E#2 are type-variables:
        E#1 extends Object declared in interface List
        E#2 extends Object declared in interface MyInterface
    1 error
    

    এই বিল্ড ত্রুটিগুলি ঠিক করার জন্য, এই ইন্টারফেসগুলি বাস্তবায়নকারী ক্লাসকে একটি সামঞ্জস্যপূর্ণ রিটার্ন টাইপ দিয়ে পদ্ধতিটি ওভাররাইড করতে হবে। উদাহরণস্বরূপ:

    @Override
    public Object getFirst() {
        return List.super.getFirst();
    }
    

নিরাপত্তা

অ্যান্ড্রয়েড ১৫-এ এমন পরিবর্তন অন্তর্ভুক্ত রয়েছে যা সিস্টেম সুরক্ষাকে উৎসাহিত করে এবং অ্যাপ এবং ব্যবহারকারীদের ক্ষতিকারক অ্যাপ থেকে রক্ষা করতে সাহায্য করে।

সীমাবদ্ধ TLS ভার্সন

Android 15 restricts the usage of TLS versions 1.0 and 1.1. These versions had previously been deprecated in Android, but are now disallowed for apps targeting Android 15.

সুরক্ষিত ব্যাকগ্রাউন্ড অ্যাক্টিভিটি লঞ্চ করা হচ্ছে

Android 15 protects users from malicious apps and gives them more control over their devices by adding changes that prevent malicious background apps from bringing other apps to the foreground, elevating their privileges, and abusing user interaction. Background activity launches have been restricted since Android 10 (API level 29).

Other changes

  • Change PendingIntent creators to block background activity launches by default. This helps prevent apps from accidentally creating a PendingIntent that could be abused by malicious actors.
  • Don't bring an app to the foreground unless the PendingIntent sender allows it. This change aims to prevent malicious apps from abusing the ability to start activities in the background. By default, apps are not allowed to bring the task stack to the foreground unless the creator allows background activity launch privileges or the sender has background activity launch privileges.
  • Control how the top activity of a task stack can finish its task. If the top activity finishes a task, Android will go back to whichever task was last active. Moreover, if a non-top activity finishes its task, Android will go back to the home screen; it won't block the finish of this non-top activity.
  • Prevent launching arbitrary activities from other apps into your own task. This change prevents malicious apps from phishing users by creating activities that appear to be from other apps.
  • Block non-visible windows from being considered for background activity launches. This helps prevent malicious apps from abusing background activity launches to display unwanted or malicious content to users.

নিরাপদ উদ্দেশ্য

অ্যান্ড্রয়েড ১৫ ইনটেন্টের জন্য StrictMode চালু করেছে।

Intent ব্যবহারের লঙ্ঘন সম্পর্কে বিস্তারিত লগ দেখতে, নিম্নলিখিত পদ্ধতিটি ব্যবহার করুন:

কোটলিন

fun onCreate() {
    StrictMode.setVmPolicy(VmPolicy.Builder()
        .detectUnsafeIntentLaunch()
        .build()
    )
}

জাভা

public void onCreate() {
    StrictMode.setVmPolicy(new VmPolicy.Builder()
            .detectUnsafeIntentLaunch()
            .build());
}

ব্যবহারকারীর অভিজ্ঞতা এবং সিস্টেম UI

অ্যান্ড্রয়েড ১৫-তে কিছু পরিবর্তন অন্তর্ভুক্ত করা হয়েছে যা আরও সামঞ্জস্যপূর্ণ, স্বজ্ঞাত ব্যবহারকারীর অভিজ্ঞতা তৈরি করার উদ্দেশ্যে।

উইন্ডো ইনসেট পরিবর্তন

There are two changes related to window insets in Android 15: edge-to-edge is enforced by default, and there are also configuration changes, such as the default configuration of system bars.

Edge-to-edge enforcement

যদি অ্যাপটি অ্যান্ড্রয়েড ১৫ (এপিআই লেভেল ৩৫) টার্গেট করে থাকে, তাহলে অ্যান্ড্রয়েড ১৫ চালিত ডিভাইসগুলিতে অ্যাপগুলি ডিফল্টভাবে এজ-টু-এজ থাকে।

এমন একটি অ্যাপ যা অ্যান্ড্রয়েড ১৪-কে লক্ষ্য করে এবং অ্যান্ড্রয়েড ১৫ ডিভাইসে এটি এজ-টু-এজ নয়।


একটি অ্যাপ যা Android 15 (API লেভেল 35) কে টার্গেট করে এবং Android 15 ডিভাইসে এটি এজ-টু-এজ। এই অ্যাপটি বেশিরভাগ ক্ষেত্রে Material 3 Compose কম্পোনেন্ট ব্যবহার করে যা স্বয়ংক্রিয়ভাবে ইনসেট প্রয়োগ করে। এই স্ক্রিনটি Android 15 এজ-টু-এজ এনফোর্সমেন্ট দ্বারা নেতিবাচকভাবে প্রভাবিত হয় না।

এটি একটি অসাধারণ পরিবর্তন যা আপনার অ্যাপের UI-তে নেতিবাচক প্রভাব ফেলতে পারে। পরিবর্তনগুলি নিম্নলিখিত UI ক্ষেত্রগুলিকে প্রভাবিত করে:

  • অঙ্গভঙ্গি হ্যান্ডেল নেভিগেশন বার
    • ডিফল্টরূপে স্বচ্ছ।
    • নীচের অফসেটটি অক্ষম করা হয়েছে তাই ইনসেট প্রয়োগ না করা পর্যন্ত বিষয়বস্তু সিস্টেম নেভিগেশন বারের পিছনে চলে যায়।
    • setNavigationBarColor এবং R.attr#navigationBarColor অবচিত এবং অঙ্গভঙ্গি নেভিগেশনকে প্রভাবিত করে না।
    • setNavigationBarContrastEnforced এবং R.attr#navigationBarContrastEnforced জেসচার নেভিগেশনের উপর কোনও প্রভাব ফেলবে না।
  • ৩-বোতাম নেভিগেশন
    • ডিফল্টরূপে অস্বচ্ছতা ৮০% এ সেট করা আছে, রঙ সম্ভবত উইন্ডোর পটভূমির সাথে মিলে যাবে।
    • ইনসেট প্রয়োগ না করা হলে, নীচের অফসেটটি অক্ষম করা হয়েছে যাতে কন্টেন্ট সিস্টেম নেভিগেশন বারের পিছনে চলে যায়।
    • setNavigationBarColor এবং R.attr#navigationBarColor ডিফল্টভাবে উইন্ডো ব্যাকগ্রাউন্ডের সাথে মেলে সেট করা আছে। এই ডিফল্টটি প্রয়োগ করার জন্য উইন্ডো ব্যাকগ্রাউন্ডটি এমন রঙ হতে হবে যা অঙ্কনযোগ্য। এই APIটি অবচিত হয়েছে কিন্তু 3-বোতাম নেভিগেশনকে প্রভাবিত করে চলেছে।
    • setNavigationBarContrastEnforced এবং R.attr#navigationBarContrastEnforced ডিফল্টরূপে সত্য, যা 3-বোতাম নেভিগেশন জুড়ে 80% অস্বচ্ছ ব্যাকগ্রাউন্ড যোগ করে।
  • স্ট্যাটাস বার
    • ডিফল্টরূপে স্বচ্ছ।
    • উপরের অফসেটটি অক্ষম করা আছে তাই ইনসেট প্রয়োগ না করা পর্যন্ত কন্টেন্ট স্ট্যাটাস বারের পিছনে চলে যায়।
    • setStatusBarColor এবং R.attr#statusBarColor অপ্রচলিত এবং Android 15 এর উপর এর কোন প্রভাব নেই।
    • setStatusBarContrastEnforced এবং R.attr#statusBarContrastEnforced বন্ধ করা হয়েছে কিন্তু তবুও Android 15-এ এর প্রভাব রয়েছে।
  • ডিসপ্লে কাটআউট
    • layoutInDisplayCutoutMode অ-ভাসমান উইন্ডোগুলির মোড অবশ্যই LAYOUT_IN_DISPLAY_CUTOUT_MODE_ALWAYS হতে হবে। SHORT_EDGES , NEVER , এবং DEFAULT ALWAYS হিসাবে ব্যাখ্যা করা হয়েছে যাতে ব্যবহারকারীরা ডিসপ্লে কাটআউটের কারণে কালো বার দেখতে না পান এবং প্রান্ত থেকে প্রান্ত পর্যন্ত প্রদর্শিত না হয়।

নিম্নলিখিত উদাহরণে Android 15 (API লেভেল 35) টার্গেট করার আগে এবং পরে এবং ইনসেট প্রয়োগ করার আগে এবং পরে একটি অ্যাপ দেখানো হয়েছে। এই উদাহরণটি বিস্তৃত নয়, এটি Android Auto তে ভিন্নভাবে প্রদর্শিত হতে পারে।

এমন একটি অ্যাপ যা অ্যান্ড্রয়েড ১৪-কে লক্ষ্য করে এবং অ্যান্ড্রয়েড ১৫ ডিভাইসে এটি এজ-টু-এজ নয়।
একটি অ্যাপ যা অ্যান্ড্রয়েড ১৫ (এপিআই লেভেল ৩৫) কে টার্গেট করে এবং অ্যান্ড্রয়েড ১৫ ডিভাইসে এটি এজ-টু-এজ। তবে, অ্যান্ড্রয়েড ১৫ এজ-টু-এজ এনফোর্সমেন্টের কারণে অনেক উপাদান এখন স্ট্যাটাস বার, ৩-বোতাম নেভিগেশন বার বা ডিসপ্লে কাটআউট দ্বারা লুকানো থাকে। লুকানো UI-তে ম্যাটেরিয়াল ২ টপ অ্যাপ বার, ভাসমান অ্যাকশন বোতাম এবং তালিকা আইটেম অন্তর্ভুক্ত রয়েছে।
একটি অ্যাপ যা অ্যান্ড্রয়েড ১৫ (এপিআই লেভেল ৩৫) কে লক্ষ্য করে, একটি অ্যান্ড্রয়েড ১৫ ডিভাইসে এজ টু এজ ব্যবহার করা হয় এবং ইনসেট প্রয়োগ করে যাতে ইউআই লুকানো না থাকে।
আপনার অ্যাপটি ইতিমধ্যেই এজ-টু-এজ কিনা তা কী পরীক্ষা করবেন

যদি আপনার অ্যাপটি ইতিমধ্যেই এজ-টু-এজ থাকে এবং ইনসেট প্রয়োগ করে, তাহলে নিম্নলিখিত পরিস্থিতিগুলি ছাড়া আপনি বেশিরভাগ ক্ষেত্রেই প্রভাবিত হবেন না। তবে, এমনকি যদি আপনি মনে করেন যে আপনি প্রভাবিত হচ্ছেন না, তবুও আমরা আপনাকে আপনার অ্যাপটি পরীক্ষা করার পরামর্শ দিচ্ছি।

  • আপনার একটি নন-ফ্লোটিং উইন্ডো আছে, যেমন একটি Activity যা LAYOUT_IN_DISPLAY_CUTOUT_MODE_ALWAYS এর পরিবর্তে SHORT_EDGES , NEVER অথবা DEFAULT ব্যবহার করে। যদি আপনার অ্যাপটি লঞ্চের সময় ক্র্যাশ করে, তাহলে এটি আপনার স্প্ল্যাশস্ক্রিনের কারণে হতে পারে। আপনি হয় কোর স্প্ল্যাশস্ক্রিন নির্ভরতা 1.2.0-alpha01 বা তার পরবর্তী সংস্করণে আপগ্রেড করতে পারেন অথবা window.attributes.layoutInDisplayCutoutMode = WindowManager.LayoutInDisplayCutoutMode.always সেট করতে পারেন।
  • কম ট্রাফিক স্ক্রিনে অক্লুডেড UI থাকতে পারে। এই কম পরিদর্শন করা স্ক্রিনগুলিতে অক্লুডেড UI নেই কিনা তা যাচাই করুন। কম ট্রাফিক স্ক্রিনের মধ্যে রয়েছে:
    • অনবোর্ডিং বা সাইন-ইন স্ক্রিন
    • সেটিংস পৃষ্ঠাগুলি
আপনার অ্যাপটি ইতিমধ্যেই এজ-টু-এজ না থাকলে কী পরীক্ষা করবেন

যদি আপনার অ্যাপটি ইতিমধ্যেই এজ-টু-এজ না থাকে, তাহলে সম্ভবত আপনিই প্রভাবিত হবেন। ইতিমধ্যেই এজ-টু-এজ অ্যাপগুলির পরিস্থিতি ছাড়াও, আপনার নিম্নলিখিত বিষয়গুলি বিবেচনা করা উচিত:

  • যদি আপনার অ্যাপটি কম্পোজে Material 3 Components ( androidx.compose.material3 ) ব্যবহার করে, যেমন TopAppBar , BottomAppBar , এবং NavigationBar , তাহলে এই কম্পোনেন্টগুলি সম্ভবত প্রভাবিত হবে না কারণ তারা স্বয়ংক্রিয়ভাবে ইনসেটগুলি পরিচালনা করে।
  • যদি আপনার অ্যাপটি Compose-এ Material 2 Components ( androidx.compose.material ) ব্যবহার করে, তাহলে এই কম্পোনেন্টগুলি স্বয়ংক্রিয়ভাবে ইনসেটগুলি পরিচালনা করে না। তবে, আপনি ইনসেটগুলিতে অ্যাক্সেস পেতে পারেন এবং সেগুলি ম্যানুয়ালি প্রয়োগ করতে পারেন। androidx.compose.material 1.6.0 এবং পরবর্তী সংস্করণগুলিতে, BottomAppBar , TopAppBar , BottomNavigation , এবং NavigationRail জন্য ম্যানুয়ালি ইনসেটগুলি প্রয়োগ করতে windowInsets প্যারামিটার ব্যবহার করুন। একইভাবে, Scaffold জন্য contentWindowInsets প্যারামিটার ব্যবহার করুন।
  • যদি আপনার অ্যাপ ভিউ এবং ম্যাটেরিয়াল কম্পোনেন্ট ( com.google.android.material ) ব্যবহার করে, তাহলে বেশিরভাগ ভিউ-ভিত্তিক ম্যাটেরিয়াল কম্পোনেন্ট যেমন BottomNavigationView , BottomAppBar , NavigationRailView , অথবা NavigationView ইনসেট পরিচালনা করে এবং কোনও অতিরিক্ত কাজ করার প্রয়োজন হয় না। তবে, AppBarLayout ব্যবহার করলে আপনাকে android:fitsSystemWindows="true" যোগ করতে হবে।
  • কাস্টম কম্পোজেবলের জন্য, প্যাডিং হিসেবে ইনসেটগুলি ম্যানুয়ালি প্রয়োগ করুন। যদি আপনার কন্টেন্টটি একটি Scaffold এর মধ্যে থাকে, তাহলে আপনি Scaffold প্যাডিং মান ব্যবহার করে ইনসেটগুলি ব্যবহার করতে পারেন। অন্যথায়, WindowInsets এর যেকোনো একটি ব্যবহার করে প্যাডিং প্রয়োগ করুন।
  • যদি আপনার অ্যাপটি ভিউ এবং BottomSheet , SideSheet অথবা কাস্টম কন্টেইনার ব্যবহার করে, তাহলে ViewCompat.setOnApplyWindowInsetsListener ব্যবহার করে প্যাডিং প্রয়োগ করুন। RecyclerView এর জন্য, এই লিসেনার ব্যবহার করে প্যাডিং প্রয়োগ করুন এবং clipToPadding="false" যোগ করুন।
আপনার অ্যাপটি কাস্টম ব্যাকগ্রাউন্ড সুরক্ষা প্রদান করবে কিনা তা কী পরীক্ষা করবেন

যদি আপনার অ্যাপটিকে ৩-বোতাম নেভিগেশন বা স্ট্যাটাস বারে কাস্টম ব্যাকগ্রাউন্ড সুরক্ষা প্রদান করতে হয়, তাহলে আপনার অ্যাপটিকে ৩-বোতাম নেভিগেশন বারের উচ্চতা পেতে WindowInsets.Type#tappableElement() ব্যবহার করে সিস্টেম বারের পিছনে একটি কম্পোজেবল বা ভিউ স্থাপন করতে হবে অথবা WindowInsets.Type#statusBars

অতিরিক্ত এজ-টু-এজ রিসোর্স

ইনসেট প্রয়োগের বিষয়ে অতিরিক্ত বিবেচনার জন্য এজ টু এজ ভিউ এবং এজ টু এজ কম্পোজ নির্দেশিকা দেখুন।

অপ্রচলিত API গুলি

নিম্নলিখিত API গুলি বন্ধ করা হয়েছে কিন্তু অক্ষম করা হয়নি:

নিম্নলিখিত API গুলি অবচিত এবং অক্ষম করা হয়েছে:

Stable configuration

If your app targets Android 15 (API level 35) or higher, Configuration no longer excludes the system bars. If you use the screen size in the Configuration class for layout calculation, you should replace it with better alternatives like an appropriate ViewGroup, WindowInsets, or WindowMetricsCalculator depending on your need.

Configuration has been available since API 1. It is typically obtained from Activity.onConfigurationChanged. It provides information like window density, orientation, and sizes. One important characteristic about the window sizes returned from Configuration is that it previously excluded the system bars.

The configuration size is typically used for resource selection, such as /res/layout-h500dp, and this is still a valid use case. However, using it for layout calculation has always been discouraged. If you do so, you should move away from it now. You should replace the use of Configuration with something more suitable depending on your use case.

If you use it to calculate the layout, use an appropriate ViewGroup, such as CoordinatorLayout or ConstraintLayout. If you use it to determine the height of the system navbar, use WindowInsets. If you want to know the current size of your app window, use computeCurrentWindowMetrics.

The following list describes the fields affected by this change:

elegantTextHeight অ্যাট্রিবিউট ডিফল্টভাবে true এ সেট করা হয়

অ্যান্ড্রয়েড 15 (API স্তর 35) লক্ষ্য করা অ্যাপগুলির জন্য, elegantTextHeight TextView বৈশিষ্ট্যটি ডিফল্টরূপে true হয়ে যায়, ডিফল্টরূপে ব্যবহৃত কমপ্যাক্ট ফন্টটিকে এমন কিছু স্ক্রিপ্টের সাথে প্রতিস্থাপন করে যেখানে বড় উল্লম্ব মেট্রিক্স রয়েছে যা অনেক বেশি পাঠযোগ্য। বিন্যাস ভাঙা প্রতিরোধ করার জন্য কমপ্যাক্ট ফন্ট চালু করা হয়েছিল; অ্যান্ড্রয়েড 13 (এপিআই লেভেল 33) fallbackLineSpacing অ্যাট্রিবিউট ব্যবহার করে টেক্সট লেআউটকে উল্লম্ব উচ্চতা প্রসারিত করার অনুমতি দিয়ে এই ধরনের অনেক ভাঙন প্রতিরোধ করে।

অ্যান্ড্রয়েড 15-এ, কমপ্যাক্ট ফন্টটি এখনও সিস্টেমে রয়ে গেছে, তাই আপনার অ্যাপটি আগের মতো একই আচরণ পেতে elegantTextHeight false সেট করতে পারে, তবে এটি আসন্ন রিলিজে সমর্থিত হওয়ার সম্ভাবনা কম। সুতরাং, যদি আপনার অ্যাপ নিম্নলিখিত স্ক্রিপ্টগুলিকে সমর্থন করে: আরবি, লাও, মায়ানমার, তামিল, গুজরাটি, কন্নড়, মালয়ালম, ওড়িয়া, তেলুগু বা থাই, তাহলে আপনার অ্যাপটি true elegantTextHeight সেট করে পরীক্ষা করুন।

অ্যান্ড্রয়েড 14 (এপিআই লেভেল 34) এবং তার নিচের অ্যাপ্লিকেশানগুলির জন্য elegantTextHeight আচরণ।
অ্যান্ড্রয়েড 15 টার্গেট করা অ্যাপগুলির জন্য elegantTextHeight আচরণ।

জটিল অক্ষর আকারের জন্য টেক্সটভিউ প্রস্থ পরিবর্তন

In previous versions of Android, some cursive fonts or languages that have complex shaping might draw the letters in the previous or next character's area. In some cases, such letters were clipped at the beginning or ending position. Starting in Android 15, a TextView allocates width for drawing enough space for such letters and allows apps to request extra paddings to the left to prevent clipping.

Because this change affects how a TextView decides the width, TextView allocates more width by default if the app targets Android 15 (API level 35) or higher. You can enable or disable this behavior by calling the setUseBoundsForWidth API on TextView.

Because adding left padding might cause a misalignment for existing layouts, the padding is not added by default even for apps that target Android 15 or higher. However, you can add extra padding to preventing clipping by calling setShiftDrawingOffsetForStartOverhang.

The following examples show how these changes can improve text layout for some fonts and languages.

Standard layout for English text in a cursive font. Some of the letters are clipped. Here is the corresponding XML:

<TextView
    android:fontFamily="cursive"
    android:text="java" />
Layout for the same English text with additional width and padding. Here is the corresponding XML:

<TextView
    android:fontFamily="cursive"
    android:text="java"
    android:useBoundsForWidth="true"
    android:shiftDrawingOffsetForStartOverhang="true" />
Standard layout for Thai text. Some of the letters are clipped. Here is the corresponding XML:

<TextView
    android:text="คอมพิวเตอร์" />
Layout for the same Thai text with additional width and padding. Here is the corresponding XML:

<TextView
    android:text="คอมพิวเตอร์"
    android:useBoundsForWidth="true"
    android:shiftDrawingOffsetForStartOverhang="true" />

EditText-এর জন্য লোকেল-সচেতন ডিফল্ট লাইন উচ্চতা

In previous versions of Android, the text layout stretched the height of the text to meet the line height of the font that matched the current locale. For example, if the content was in Japanese, because the line height of the Japanese font is slightly larger than the one of a Latin font, the height of the text became slightly larger. However, despite these differences in line heights, the EditText element was sized uniformly, regardless of the locale being used, as illustrated in the following image:

Three boxes representing EditText elements that can contain text from English (en), Japanese (ja), and Burmese (my). The height of the EditText is the same, even though these languages have different line heights from each other.

For apps targeting Android 15 (API level 35), a minimum line height is now reserved for EditText to match the reference font for the specified Locale, as shown in the following image:

Three boxes representing EditText elements that can contain text from English (en), Japanese (ja), and Burmese (my). The height of the EditText now includes space to accommodate the default line height for these languages' fonts.

If needed, your app can restore the previous behavior by specifying the useLocalePreferredLineHeightForMinimum attribute to false, and your app can set custom minimum vertical metrics using the setMinimumFontMetrics API in Kotlin and Java.

ক্যামেরা এবং মিডিয়া

অ্যান্ড্রয়েড ১৫ বা তার উচ্চতর ভার্সনের অ্যাপগুলির জন্য ক্যামেরা এবং মিডিয়া আচরণে নিম্নলিখিত পরিবর্তনগুলি আনে।

অডিও ফোকাসের অনুরোধের উপর বিধিনিষেধ

Apps that target Android 15 (API level 35) must be the top app or running a foreground service in order to request audio focus. If an app attempts to request focus when it does not meet one of these requirements, the call returns AUDIOFOCUS_REQUEST_FAILED.

You can learn more about audio focus at Manage audio focus.

আপডেট করা নন-SDK বিধিনিষেধ

Android 15 includes updated lists of restricted non-SDK interfaces based on collaboration with Android developers and the latest internal testing. Whenever possible, we make sure that public alternatives are available before we restrict non-SDK interfaces.

If your app does not target Android 15, some of these changes might not immediately affect you. However, while it's possible for your app to access some non-SDK interfaces depending on your app's target API level, using any non-SDK method or field always carries a high risk of breaking your app.

If you are unsure if your app uses non-SDK interfaces, you can test your app to find out. If your app relies on non-SDK interfaces, you should begin planning a migration to SDK alternatives. Nevertheless, we understand that some apps have valid use cases for using non-SDK interfaces. If you can't find an alternative to using a non-SDK interface for a feature in your app, you should request a new public API.

To learn more about the changes in this release of Android, see Updates to non-SDK interface restrictions in Android 15. To learn more about non-SDK interfaces generally, see Restrictions on non-SDK interfaces.