9

Support foldable and dual-screen devices with Jetpack WindowManager

 3 years ago
source link: https://codelabs.developers.google.com/codelabs/android-window-manager-dual-screen-foldables#0
Go to the source link to view the article. You can view the picture content, updated content and better typesetting reading experience. If the link is broken, please click the button below to view the snapshot at that time.

Support foldable and dual-screen devices with Jetpack WindowManager

Select an option
Support foldable and dual-screen devices with Jetpack WindowManager

About this codelab

subjectLast updated Mar 4, 2021
account_circleWritten by Cesar Valiente (Microsoft) /Kenneth Ford (Google)

1. Before you begin

This practical codelab will teach you the basics of developing for dual-screen and foldable devices. When you're finished, you'll be able to enhance your app to support devices like the Microsoft Surface Duo and the Samsung Galaxy Z Fold 2.

Prerequisites

To complete this codelab, you'll need:

  • Experience building Android apps
  • Experience with Activities, Fragments, ViewBinding, xml-layouts
  • Experience adding dependencies to your projects
  • Experience installing and using device emulators. For this codelab you'll use a foldable and/or dual screen emulator.

What you'll do

  • Create a simple app and enhance it to support foldable and dual-screen devices.
  • Use Jetpack WindowManager to work with new form factor devices.

What you'll need

  • Android Studio 4.2 or higher
  • A foldable device or emulator If you are using Android Studio 4.2, there are a few foldable emulators you can use, as shown in the image below:

7a0db14df3576a82.png

  • If you want to use a dual screen emulator, you can download the Microsoft Surface Duo emulator for your platform (Windows, MacOS or GNU/Linux) here.

Note: In this codelab we have used the dual screen and the 6.7" Horizontal Fold-in emulators. If you use other foldable emulators, you may or may not have to make some changes in the code (mainly Jetpack WindowManager code) in order to have the code working properly in those particular emulators.


About Joyk


Aggregate valuable and interesting links.
Joyk means Joy of geeK