Android Question Recommendations for Android 15 and 16

Cleidson

Member
Hello everyone,
I recently received an email from the Google Play Console asking me to update an app that I have published on the service. The update was something simple, but when I accessed the service to perform the requested update, I came across the following recommendations to be carried out:

B4X:
The app uses deprecated APIs or parameters for edge-to-edge display
One or more of the APIs used or parameters set for edge-to-edge and window display were deprecated in Android 15. Your app uses the following deprecated APIs or parameters:
androidx.core.view.WindowCompat.setDecorFitsSystemWindows
android.view.Window.setDecorFitsSystemWindows
androidx.core.view.WindowCompat$Api30Impl.setDecorFitsSystemWindows
LAYOUT_IN_DISPLAY_CUTOUT_MODE_SHORT_EDGES
They start at the following places:
androidx.compose.ui.window.DialogWrapper.<init>
androidx.core.view.WindowCompat$Api30Impl.setDecorFitsSystemWindows
androidx.core.view.WindowCompat.setDecorFitsSystemWindows
androidx.activity.EdgeToEdgeApi28.adjustLayoutInDisplayCutoutMode
To prepare for the move to Android 15, migrate APIs or parameters.
User Experience
Version Name: xxxx
Remove app resizing and orientation restrictions to support large-screen devices
Starting with Android 16, the system will ignore resizing and orientation restrictions for large-screen devices such as foldables and tablets. This may cause layout and usability issues for users.
We have detected the following resizing and orientation restrictions in your app:
<activity android:name=".main" android:screenOrientation="PORTRAIT" />

To improve the user experience of your app, remove these restrictions and verify that your app's layouts work across multiple screen sizes and orientations by testing on Android 16 and older.
I believe the second recommendation is easy to solve. I believe that by commenting on

B4X:
#Region Project Attributes
#ApplicationLabel: xx
#VersionCode: xx
#VersionName: xx
'SupportedOrientations possible values: unspecified, landscape or portrait.
#SupportedOrientations: portrait
#CanInstallToExternalStorage: False
#End Region

The line #SupportedOrientations: portrait will ensure that the recommendation is met. Regarding testing on Android 16, which has not yet been released, I am unable to perform the test at the moment.

As for the first recommendation, I have no idea where to check the origin and replace it, as requested. I even read the manifesto, but I didn't find any reference to the aforementioned APIs.
I have been doing research on this situation and some of it leads me to believe that it is due to “User experience and system interface”.
My manifest has the following configurations:

B4X:
AddManifestText(
<uses-sdk android:targetSdkVersion="34"/>
<supports-screens android:largeScreens="true"
 android:normalScreens="true"
 android:smallScreens="true"
 android:anyDensity="true"/>)
SetApplicationAttribute(android:icon, "@drawable/icon")
SetApplicationAttribute(android:label, "$LABEL$")
'CreateResourceFromFile(Macro, Themes.LightTheme)
SetApplicationAttribute(android:allowBackup, "false")
SetApplicationAttribute(android:theme, "@style/MyAppTheme")
SetApplicationAttribute(android:usesCleartextTraffic, "false")
'End of default text.
CreateResource(values, theme.xml,
<resources>
 <style name="MyAppTheme" parent="Theme.AppCompat.Light.NoActionBar">
 </style>
</resources>
)

CreateResourceFromFile(Macro, FirebaseAnalytics.GooglePlayBase)
CreateResourceFromFile(Macro, FirebaseAnalytics.Firebase)
CreateResourceFromFile(Macro, FirebaseAnalytics.FirebaseAnalytics)
CreateResourceFromFile(Macro, FirebaseNotifications.FirebaseNotifications)

AddPermission(android.permission.USE_BIOMETRIC)
AddPermission(android.permission.INTERNET)
AddPermission(android.permission.ACCESS_NETWORK_STATE)
AddPermission(android.permission.POST_NOTIFICATIONS)

I would appreciate any guidance on how to resolve this issue.
 

Erel

B4X founder
Staff member
Licensed User
Longtime User
The new requirements are part of targetSdkVersion=36 with some exceptions (large devices only and there is an option to run in compatibility mode). There is still quite a lot of time before this becomes mandatory.


This is a breaking change and will require some modifications. B4A will be updated before to help with this change.
 
Upvote 0
Top