Android 12L for developers on Surface Duo

Guy Merin

Hello Android developers!

We’re excited to see that Android 12L is being rolled out to Surface Duo devices, and equally keen to see what the Android developer community builds to support it.

Android 12L for foldable app developers

The good news for developers is that dual-screen APIs have not changed and foldable app enhancements written for earlier versions of Android will continue to work. Here are just a few of the ways that developers build foldable and large-screen aware apps for Android 12L:

Dual-screen libraries

Take advantage of our developer and designer resources at including the library of dual-screen layouts that includes: FolableLayout, Snackbar, BottomNavigation, FoldableNavigation, and the latest NavigationRail component.

To see the user experiences possible on foldable devices, download the Dual Screen Experience Example from Google Play (or get the source).

Google Play screenshots of the dual screen experience app

Jetpack Window Manager 1.0

Existing Jetpack Window Manager APIs like FoldingFeature and SlidingPaneLayout will continue to work as expected in Android 12L. You can download and try a variety of samples from GitHub and follow this Codelab to learn more.

Three Surface Duo devices running Android 12L sample apps (for illustrative purposes)

Jetpack Window Manager 1.1 alpha

Existing Jetpack Window Manager APIs like FoldingFeature will continue to work as expected in the new OS. You can download and try a variety of samples from GitHub.

Android 12L also enables some new features in Jetpack Window Manager. The 1.1 alpha version includes a mechanism to make existing Activity-based apps dual-screen and large-screen aware – Activity Embedding. The screenshot below shows activity embedding at work:

Activity embedding sample

Large screen improvements

Android 12L also brings improved multitasking features that re-create the same side-by-side app productivity experience from Surface Duo on more devices via split-screen mode. App developers that have invested in adaptive layouts and drag-and-drop will see a larger number of customers able to take advantage of those features.

Design Kit

Our Surface Duo Design Kit has also been updated with more large screen guidance to help build adaptive user experiences that work well across device types with Android 12L. Examples include when to use navigation rail and how to combine design patterns in a user task flow.

Design kit screenflow examples for a list detail user experience

Updated Surface Duo emulator images

To make sure developers can also build and test their apps with Android 12L (API level 32), there is also an updated Surface Duo emulator available. Follow the installation instructions to download the Android 12L emulator installer for your platform (Windows, Mac, or Linux). For the first time, we also have a download for Mac computers with Apple Silicon!

Once installed, you will see two new icons – the glacier-colored icon is for the Surface Duo emulator, and the obsidian-colored icon is for the Surface Duo 2 form factor.

Surface Duo emulator app icons

(macOS users will use shell scripts to start the required emulator, but will see the icon in the dock)

Once you’ve started the Surface Duo Android 12L emulator, it will appear in the deploy/debug menu of your IDE, including Android Studio and Visual Studio. You can then use the same device posture feature as previous versions to test how your apps behave on folding devices.

Surface Duo emulator screenshot showing the launcher app with icons and news widget, as well as the device pose tab in the settings window

Note that the Android 12L emulator has a minimum version requirement for the Android Emulator in SDK Tools. Ensure that you have version 31.3.12 or newer (or if you have a canary build, version 32.1.5 or newer). Updating may in turn cause issues with older Surface Duo emulators, which can be resolved by following these instructions.

Resources and feedback

If you have questions about foldable development or want to share your work, please reach out to us on Tech Community or find us on Twitter @surfaceduodev.

You can also live chat with us on Twitch this Friday at 11am PST, where we will share more insights on Android 12L and developing for foldable and large screen devices!