Microsoft Surface Duo Emulator updated with Jetpack Window Manager preview

Guy Merin

Guy

Hello Android dual-screen developers!

Today we’re excited to share the latest Surface Duo emulator preview. Since our last update, we’ve been busy incorporating feedback and adding new features.

What’s new in updated build 2020.710.3:

  • Support for the Jetpack Window Manager preview
  • Bug fixes

You can download the latest build for Windows, macOS, or Linux at the Microsoft Download Center. Additional setup instructions are included in the SDK documentation. We recommend that you uninstall the previous version before installing the updated build.

Microsoft support for WindowManager in Surface Duo

The Android Jetpack WindowManager addition has recently been updated by Google to support various new mobile form factors like foldable and dual screen devices.

Microsoft welcomes these additions. These new AndroidX windowing concepts such as DeviceState and DisplayFeature allow Android application developers to create compelling user experiences for these unique form factors.

The Surface Duo device will include androidx.window.sidecar support when it launches and update to androidx.window.extensions when these are officially released, allowing apps to use these new foldable/dual screen AndroidX APIs when running on the Surface Duo and other dual screen devices.

Microsoft encourages developers to use the Jetpack library to create dual screen experiences. You can learn more about how to use these APIs by reading the Surface Duo dual-screen documentation, by using dual screen AndroidX based samples, located here and here, and by reading the AndroidX Windowing documentation.

Jetpack Window Manager preview

The release of build 2020.710.3 of the Surface Duo Emulator Image is our first preview that includes Android’s dual-screen support using WindowsManager Jetpack library.

Read more about it in the Android Developers blog on developing for foldables and in this video.

Trying it out

Google’s sample code also included a Window Manager sample that shows how to detect display features (a hinge or fold) and layout screens using just the Jetpack Window Manager package (which is currently in preview). To add this support to your app, add the following dependency to your gradle file:

dependencies {

implementation “androidx.window:window:1.0.0-alpha01”

}

You’ll then be able to import the androidx.window.WindowManager and related classes, and use them to detect the hinge and respond to layout changes as the app is spanned and unspanned. You can review the sample code from Google, and see the output here:

Image 1: AndroidX Windows Manager sample

Next steps

Developers building Surface Duo apps today have a choice to continue to use the Microsoft Surface Duo SDK which is ready for deployment, or decide on a migration strategy to the Foldables Jetpack library provided by Google either now in its Preview/Alpha state or when it is fully completed.

We look forward to supporting you on both options.

Feedback

We’d love to hear from you! Please leave us feedback using our feedback forum, or message me on Twitter or GitHub.

 

0 comments

Leave a comment