Android 16 Screen Orientation Deprecation and Large Screen Adaptation Guide
Starting with Android 16, Google deprecates manifest screen‑orientation and resizability attributes for large‑screen devices (sw ≥ 600dp), forcing apps targeting API 36+ to adopt responsive layouts—such as Compose window‑size classes, TwoPane, Activity Embedding, or Flutter frameworks—while offering a temporary opt‑out property before mandatory adaptation in API 37.
For Android developers, declaring an Activity traditionally involved adding android:screenOrientation="portrait" . However, since Android 12 (targetSdkVersion ≥ 31), warnings appeared in Android Studio 3.6 regarding this practice.
Starting from Android 12, certain foldable devices ignore user-configured screenOrientation and force Activities into Letterboxing mode. Whether to enter Letterboxing mode depends on TargetSDK version, app configuration, and screen resolution.
From Android 16, Google is progressively deprecating manifest attributes and runtime APIs used to restrict app screen orientation and resizability , initially affecting "large screen" scenarios where the minimum display width is ≥ 600dp (sw >= 600dp):
Inner screens of large foldable devices
Tablets including desktop window mode
Desktop environments including Chromebooks
Specifically, after TargetSDK >= 36 with sw >= 600dp, the following configurations and APIs will be ignored:
Games marked with android:appCategory are temporarily exempt from these changes.
In large screen scenarios, apps with screenOrientation set previously appeared in letterboxed state; starting from Android 16, they will be stretched to fill the screen.
Not upgrading targetSDK is no longer viable as Google Play now requires targetSDK upgrades:
Android 16 (2025) : With API 36, configuration can opt out temporarily
Android versions in 2026 : API 37 requires mandatory adaptation
For API 36, developers can use PROPERTY_COMPAT_ALLOW_RESTRICTED_RESIZABILITY to delay adaptation:
<activity...>
<property android:name="android.window.PROPERTY_COMPAT_ALLOW_RESTRICTED_RESIZABILITY" android:value="true" />
...
</activity> <application...>
<property android:name="android.window.PROPERTY_COMPAT_ALLOW_RESTRICTED_RESIZABILITY" android:value="true" />
</application>Additionally, R.attr#windowOptOutEdgeToEdgeEnforcement is deprecated in API 36, preventing apps from forcing exit of edge-to-edge mode.
Recommended adaptation approaches:
1. Responsive layouts using Compose or Flutter
2. Compose with material3-window-size-class library using calculateWindowSizeClass() to compute WindowSizeClass and adjust UI layout:
import androidx.activity.compose.setContent
import androidx.compose.material3.windowsizeclass.calculateWindowSizeClass
class MyActivity : ComponentActivity() {
override fun onCreate(savedInstanceState: Bundle?) {
super.onCreate(savedInstanceState)
setContent {
// Calculate the window size class for the activity's current window. If the window
// size changes, for example when the device is rotated, the value returned by
// calculateSizeClass will also change.
val windowSizeClass = calculateWindowSizeClass(this)
// Perform logic on the window size class to decide whether to use a nav rail.
val useNavRail = windowSizeClass.widthSizeClass > WindowWidthSizeClass.Compact
// MyScreen knows nothing about window size classes, and performs logic based on a
// Boolean flag.
MyScreen(useNavRail = useNavRail)
}
}
}3. TwoPane from accompanist-adaptive for foldable adaptation with two fixed slots driven by TwoPaneStrategy
4. FlowLayout (FlowRow/FlowColumn) for automatic wrapping in foldable expand/collapse scenarios
5. Activity Embedding for traditional View scenarios - can be configured via XML or Jetpack WindowManager API
6. SlidingPaneLayout as a compatibility option
7. Custom adaptation using Jetpack WindowManager's FoldingFeature
Android Studio's emulator provides corresponding scenario support for developers without foldable devices. For Flutter, frameworks like responsive_sizer , flutter_flexible_ui , and ResponsiveFramework provide dynamic device support for large screens.
These changes align with Android's PC ambitions, supporting scenarios including Linux terminal console, desktop mode, external display support, windowed multitasking, minimize, multi-instance, Desktop View, and external display arrangement. With Android XR window scenarios also emerging, large screen adaptation demand will only increase.
Sohu Tech Products
A knowledge-sharing platform for Sohu's technology products. As a leading Chinese internet brand with media, video, search, and gaming services and over 700 million users, Sohu continuously drives tech innovation and practice. We’ll share practical insights and tech news here.
How this landed with the community
Was this worth your time?
0 Comments
Thoughtful readers leave field notes, pushback, and hard-won operational detail here.