Design your apps for foldables

Foldable device partially folded, showing the front of the device.

Android 10 (API level 29) adds more support for foldable devices.

Unfolding a device to provide a larger screen can have a positive impact on usability:

  • A larger screen usually means a more immersive experience
  • With multi-window mode, users can multi-task

Folding and unfolding a device can change the size, density, or aspect ratio of the display. This is not a new problem in Android development; it's also a concern in use cases that don't involve foldable devices, for example:

  • Switching between portrait and landscape orientation on phones and tablets
  • Resizing Android apps on Chrome OS in desktop mode
  • Using devices with multiple displays

This page describes best practices to make sure your app works well with foldable form factors.

You may also want to read the Android 10 summary of changes: Support for foldables.

App continuity

When running on a foldable device, an app can transition from one screen to another automatically. After the transition, the app should resume in the same state and location, and the current task should continue seamlessly.

Animation of a foldable device folding outward.

Since the system triggers a configuration change during a fold or unfold transition, apps should save the UI state and support configuration changes gracefully.

Note: Foldable devices can fold in many ways, such as inward (with the display folding into the interior of the device) or outward (with the display wrapping around the device).

Make your app resizable

Ensure that your app works in multi-window mode and with dynamic display resizing. To provide maximum compatibility with whatever form factors and environments your app might encounter (like foldables, desktop mode, or free-form windows), set resizeableActivity=true in the <application> or <activity> section of the project manifest file. Test your app's behavior in split-screen mode or with a foldable emulator.

If your app sets resizeableActivity=false, the app will not support multi-window mode. The system may still resize your app or put it in multi-window mode, but compatibility is implemented by applying the same configuration to all the components in the app, including all activities and services. In some cases, major changes (like a display size change) might restart the process rather than change the configuration.

For example, the activity below has set resizableActivity=false along with a maxAspectRatio. When the device is unfolded, the activity configuration, size, and aspect ratio are maintained by putting the app in compatibility mode.

Foldable device showing an application that only partially fills
          the unfolded display area.

If you set resizeableActivity=false to disable multi-window mode but still want to support app continuity, add the following metadata to the <application> element of your manifest file:

    android:name="android.supports_size_changes" android:value="true" />

If supports_size_changes is true and the user folds or unfolds the device, the activity applies any changed configurations in a way that supports changes in window sizes.

If you do not set resizeableActivity (or you set it to true) the system assumes the app fully supports multi-window mode and is resizable.

Note that some OEMs might implement a feature that adds a small restart icon on the screen each time the activity's display area changes. This gives the user the chance to restart the activity in the new configuration.

Use WindowManager

Foldable devices, like non-foldables, support a variety of windowing modes.

To obtain the correct app bounds on foldable devices regardless of windowing mode, use the following WindowManager methods:

The Jetpack WindowManager library methods computeMaximumWindowMetrics() and computeCurrentWindowMetrics() provide the same functionality along with compatibility down to API level 14.

Foldable Modes

Foldable devices have either a fold in the display or a hinge that separates two portions (typically halves) of the display. Devices with a hinge might have the ability to span content behind the hinge; for example, the Microsoft Surface Duo in its spanned mode. Some devices may be able to be placed in a half-folded configuration or other posture such as Samsung's Flex Mode.

The Jetpack WindowManager library gives you a device-agnostic way of reacting to device modes, configuration changes, and display features. See the blog post, Support new form factors with the new Jetpack WindowManager library, to learn more.


Foldable devices can support the postures shown below, which correspond to the FoldingFeature state constants FLAT and HALF_OPENED. The FoldingFeature class is part of the Jetpack WindowManager library. FoldingFeature identifies devices that have a hinge or a display fold. FoldingFeature implements the DisplayFeature interface (which can be implemented by new display types as the device ecosystem continues to grow).

Vertically foldable device fully open.
Vertically foldable device opened halfway in tabletop posture.
(Tabletop posture)

Use the FoldingFeature class to retrieve device postures. You can check directly for the following states:

Or you can use the following properties that abstract the state of a folding device:

Use these properties to recognize different postures like tabletop mode (where the hinge or fold is horizontal) or book mode (where the hinge or fold is vertical):

private fun isTableTopMode(foldFeature: FoldingFeature) =
        foldFeature.state == FoldingFeature.State.HALF_OPENED &&
            foldFeature.orientation == FoldingFeature.Orientation.HORIZONTAL

private fun isBookMode(foldFeature: FoldingFeature) =
        foldFeature.state == FoldingFeature.State.HALF_OPENED &&
            foldFeature.orientation == FoldingFeature.Orientation.VERTICAL

You can be notified of any changes in the FoldingFeature state by collecting events from the windowLayoutInfo Kotlin flow available in the WindowInfoRepository class:

val windowInfoRepository = windowInfoRepository()
lifecycleScope.launch(Dispatchers.Main) {
    // The block passed to repeatOnLifecycle is executed when the lifecycle
    // is at least STARTED and is cancelled when the lifecycle is STOPPED.
    // It automatically restarts the block when the lifecycle is STARTED again.
    lifecycle.repeatOnLifecycle(Lifecycle.State.STARTED) {
        // Safely collects from windowInfoRepository when the lifecycle is
        // STARTED and stops collection when the lifecycle is STOPPED.
            .collect { newLayoutInfo ->
                // Check newLayoutInfo.displayFeatures to see if the
                // feature list includes a FoldingFeature, then check
                // the feature's data.

Jetpack WindowManager also makes available WindowInfoRepositoryCallbackAdapter, a Java-compatible interface of WindowInfoRepository. The adapter receives updates by registering a callback in the application with addWindowLayoutInfoListener.

To stop receiving updates, remove the callback using removeWindowLayoutInfoListener.

The callback receives data in a WindowLayoutInfo object which contains a list of the window's display features. Use the displayFeatures property to access the information:

class LayoutStateChangeCallback implements Consumer<WindowLayoutInfo> {
    public void accept(WindowLayoutInfo windowLayoutInfo) {
      // Check windowLayoutInfo.displayFeatures to see if the
      // feature list includes a FoldingFeature, then check
      // the feature's data.

A sample showing how to use and test these functionalities is available on GitHub.

Hinge angle

Starting with Android 11, apps running on devices with hinged screens can determine the angle of the hinge if the device has a sensor that provides a TYPE_HINGE_ANGLE value and reports a SensorEvent that provides the number of degrees of the hinge angle. You can use these measurements to perform granular animations as the user manipulates the device.

Even though some kinds of apps (such as launchers and wallpapers) may find it useful to know the exact hinge angle, most apps should use the Jetpack WindowManager library to retrieve the device posture because responding to the posture is more reliable due to the many different device configurations currently in the market (with more coming in the future).


To get your app ready for foldables, you should test how your app reacts to:

  • Configuration changes
  • Multi-window mode and multi-resume
  • Resizing and new display aspect ratios

Foldable emulators

The Android Open Source Project (AOSP) includes a variety of device emulators that simulate the functionality of foldable devices.

Android Studio's Android Virtual Device (AVD) Manager enables you to easily test your app using foldable device emulators.

Animation of a foldable device opening and closing in a device

Foldable device emulator.


The Force desktop developer option enables you to turn on system decoration support on all secondary displays. Force desktop mode also displays a mouse pointer on the secondary displays instead of on the default display. When used with the Enable Freeform windows developer option, Force desktop simulates a desktop experience with multi-window mode and the ability to resize windows.

You can work with multiple displays using a simulated display or, if you have a device that supports HDMI or DisplayPort over USB-C, using a wired connection.

Phone showing a dialog box that enables selection of various types
          of simulated secondary displays.

Simulated display.