Since the second half of last year, we’ve seen Android device makers create a new category: foldable phones. The device’s screen takes advantage of new flexible screen technology that actually bends and folds.
Current situation of foldable screen devices
Simply speaking, we can divide the foldable mobile phones on the market into two categories according to the position of the flexible screen in the folded state.
Folding mobile phone classification
Fold in
The first one is Fold in.
When it’s folded, the flexible screen is inside the fold, and when we see the first picture on the screen, if we look closely, inside the fold we can see what’s displayed. When the device is folded, it has an extra non-flexible screen on the outside, which is very suitable for the user to do some relatively simple, quick response operations.
Fold out
The second category is called Fold out.
When it is folded, its flexible screen is still outside of the folded screen. In the folded state, only part of the flexible screen continues to be used, and part of the flexible screen can also be used as an ordinary folding screen.
Back in November, we held our annual Android Developer Summit, where we announced native support for foldable devices. This means that if you follow our recommended best practices when developing your app, your app will run on these new devices without any changes.
Best practices include whether your Activity can resize itself according to the current screen size, whether it handles configuration changes correctly, and whether you can save and restore the user’s previous state when the configuration changes.
The experience of using a foldable phone
-
First of all, when the screen is folded, basically you can think that it is similar to an ordinary mobile phone, suitable for one-handed operation, and convenient for you to do some quick responses, such as answering the phone and answering messages.
-
When unfolded, a foldable phone typically has a large screen of 7 to 8 inches, giving it a very similar experience to a tablet device. It’s such a big screen. With such a large screen, the layout of your app is very important, and we encourage developers to take advantage of such a large display area and not use a single pixel.
-
It is also more suitable for split-screen display than a normal mobile phone screen on a large flexible screen that unfolds. With a 50:50 split display, the experience is similar to putting two normal phones side by side.
UX consider
We’ve seen some foldable phones that can support three apps at once, showing that Android developers are already familiar with 16:9 and 18:9 aspect ratios. But the advent of foldable phones has brought with it some new long screen aspect ratios. It’s also time for developers to think about how your app will look on these new aspect ratios. The new aspect ratio could be 21:9, or even longer, lanky screens, or it could be something closer to rectangular and closer to square, a dumpy display with a 1:1 aspect ratio. In the unfolding state of the folding screen, we hope that you can use the screen to the extreme.
Of course, we know that in some special cases, as an app developer, you may need to set the maximum or minimum aspect ratio that your app can support. In such cases, you can use maxAspectRatio, introduced from Android 8.0, to set the maximum aspect ratio supported. You can also use our new minAspectRatio on AndroidQ to set the minimum aspect ratio you can support.
Application connectivity
Specifically, you need to pay special attention to the following aspects:
The first step is to choose the right layout for your application
The second thing to notice is that you want to be able to recover to where the user was before. For example, if your interface had a scroll bar before the switch, your application should be able to ensure that the scroll bar is in the same position as it was before the switch.
Multi-window
Regarding the resizeableActivity attribute, it was introduced from Android 7.0 along with multi-Window. You can set the properties for your activity and application in the application’s Manifast file.
This property indicates whether activities and applications can enable or disable multi-window displays. If this property is set to true, your activity can be started in split-screen and free-shape mode. If this property is set to false, it does not mean that your activity will never be resized. It does mean that it cannot support multi-window mode. If this value is set to false and the user tries to start the activity in multi-window mode, the activity is shown to the user in full-screen mode,
For a better user experience, we certainly don’t want developers to show their apps in black Box mode. We recommend that developers set the resizeableActivity property to True and choose an appropriate application layout to have a good user experience in multi-window mode.
Before Android, it was possible to have more than one activity on the screen at a time, but only one resume state at a time. If multiple activities are displayed on the current screen, only those activities with focus are in resume mode, while other applications are visible but are in PAUSED state. Although we provided an implementation for handling multiple applications on the same screen in our article on multi-window support on the developer website, we found that the vast majority of application developers do not handle onPAUSED state as recommended by our best practices.
When your Activity is moved to a different display device, you need to keep in mind that three changes can occur.
What if your application wants to display additional screens connected to the current system? The first is to examine all display content currently connected to the current system by using DisplayManager. Different displays may have different characteristics, you can call the interface to check the indicators and status of each display device, and determine whether you need to use the display device.
For example, if you want to display a high resolution photo, you can do a filter to select the screen with a larger size and higher resolution to display the image. Of course, there are also cases where you can check whether the current connected display device is turned off or not, because it has no value to you in that case, so you can just filter them out.
Multi-display
The Launchers class in AOSP implements the proprietary Activity category. So we also have a multi-display launcher example in AOSP that shows how to use the new functionality.
How to test
We also know that it’s hard for developers to have a real foldable phone device to test the performance of your app these days. In Android Studio, we also provide some solutions to help you handle this situation.
Developer documentation
We also have a very detailed tutorial on how to adapt these foldable devices on the developer website. You can scan the QR code now on the screen to read the tutorial, and we hope you can make your app work with these foldable phones as soon as possible.
Click: Developer Documentation
Android Q Labs live features page
Android Q Labs opening speech
What are the updates to Android Q
Android Q modernizes your application
Restrictions on background Activity startup
Android Q partitioned storage
Android Q gesture navigation
Jetpack update
Introduction to common system images
Google Play Store policy
Android Q location permission changed
Android Q has a dark theme
Android Q Labs concludes the presentation