How to Build Apps for Foldable Smartphones?

Manish Barthwal
Dew Solutions
Published in
6 min readJul 27, 2021

Foldable smartphones were extremely popular back in their heyday. Having a flip phone at that time used to be a trend. Guess what? They are back, with Samsung and Huawei launching their foldable smartphone in the market again in 2019.

Foldable smartphones seemed to disappear from the scene, that’s what we all thought but not these two companies who have tried to bring the trend back. Mobile app development companies had stopped designing applications for such smartphones as they thought it was no longer required since the manufacturing and production of these devices were put to a halt.

Now since they have arrived again, app development companies, too, have started to shift their attention towards this particular segment. The new foldable devices are different from the previous ones, with a larger screen size and flexible display. Some devices may fold out on a horizontal axis into a wider, tablet-like form, but are still usable in a smaller, folded state; the display may either wrap around to the back of the device when folded (as with the Huawei Mate X), or use a booklet-like design where the larger, folded screen is located on the front, and a screen on one of its backside allows the user to interact with the device without opening it (such as the Samsung Galaxy Fold).

That is why app development for foldable devices is a bit challenging because folding and unfolding the device changes the screen size, density, or ratio. Developers need to take care of every minute detail and consider the different foldable device types, like the one with a single screen that unfolds as well as the device with two different screens. At the same time, they have to check for any hardware limitations.

How would foldable smartphones affect the app development process?

Foldable devices offer a flexible user experience when browsing apps. Unfolding the device to a larger screen may leave a positive impact on users. Streaming applications can utilize the extended screen size to display videos in a bigger dimension. A larger screen accounts for a more immersive experience.

With multi-windows, multi-tasking becomes quite easy and enjoyable. It allows users to switch between applications and work effortlessly and makes the experience much more enhanced.

Speaking of how it will affect the app development process, the number of test cases would definitely increase. With more brands likely to launch their foldable smartphone in the market soon, the development team will have a great number of test cases to deal with. Along with this, the time and cost to develop an app for a foldable device will also be at the higher end since it will require a lot of design, development, and testing efforts, which will eventually result in high development costs.

How to develop an app for a foldable device?

We have breakdown app development for a foldable device into a number of steps-

Two-state app screen

When designing such an app, you need to consider its two states- foldable state as well as the non-foldable state. The latter here refers to the main display or screen while the former refers to the cover display. As discussed earlier in the example of Huawei Mate X and Samsung Galaxy Fold, an unfolded folded state is the one where the device transforms in the form of a tablet whereas the folded state is where the device looks like a normal smartphone. These states change the entire user experience, as not only the screen size changes but also how the user has held the device. People usually operate their smartphones with one hand but a foldable smartphone will require them to use both their hands.

App or Screen Continuity

Foldable devices are such that an app adjusts itself to the screen size when someone switches between screens. So while designing an app for a foldable smartphone, ensure that the transition is smooth when a user moves from the folded state to the unfolded state and vice-versa, without having to face any trouble in their current task else it can hamper the user experience. The app should resume in the same state. Since the device will experience a configuration change during the transition, the app should save the UI state and support these changes without causing any change in the layout.

Multi-window

One of the major benefits of having a large screen is that you can run multiple windows on it. Earlier this was restricted to two apps only where users could use multi-screen to use two apps, but it had a major drawback. Only one app out of the two could remain active while the other used to get paused. Today, primarily with the launch of foldable devices, one can run three or more apps on the screen at the same time with all being in the resumed/active.

Therefore, ensure that the app supports multi-window. You can also consider supporting drag and drop.

Technical Know-how

Developers can make the above changes through the following steps-

To make the app resizable-

Set “resizeableActivity=true”. This would ensure that the app supports dynamic resizing and works in multi-window mode, and would provide maximum compatibility with whatever environment or form factors your app may experience. If the app sets it to “resizeableActivity=false, it means the app doesn’t support multi-window. It might still resize your app but it might nt]ot be appropriate or have a different aspect ratio.

If you want the app to support screen continuity but want to disable multi-window mode, you can add the below-mentioned meta to the manifest of your element.

<meta-data

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

If the user folds or unfolds a device when the value is true, the system will apply the changed configurations and will assume that the app fully supports multi-window and is resizable.

For new screen ratios

In the case of foldable devices, the screen ratio can vary from 21:1 to 1:1. And you also need to consider the latest Android versions. Android 10 and above versions support a wide range of aspect ratios.

To make sure that the app is compatible with as many devices as possible, test the app for various screen ratios such as 1:1, 4:3, 3:2,16:10, 5:3, 16:9, and 21:9.

If the app isn’t able to support any of the above screen ratios, you can use “maxAspectRatio” and “miniAspectRatio” to indicate the maximum and minimum ratio your app can handle.

Multi-resume

Until Android 9, only the app that is in focus used to be in the resumed state while all other activities remained paused. However, with the introduction of Android 10, all the activities remain in the resumed state when the device is in multi-window mode. This is what we call multi-resume. To ensure that your app supports the multi-resume feature, add the below-mentioned manifest metadata.

<meta-data

android:name=”android.allow_multiple_resumed_activities” android:value=”true” />

Multi-Display

Technology in the future might introduce us to smartphones that support more than one screen at a time which we refer to as multi-display. If the user is running activity on a device with multi-display compatibility, he or she can move the activity from one display to another. Devices having multi-display support will support multi-resume as well.

The app can specify which screen it should run on when it is launched or creates another activity. It depends on the activity launch mode defined in the manifest file, and in the intent flags and options set by the person launching the activity.

Speaking of when folding transitions occur and an activity moves to a secondary display, it can go through a window resize, context update, and configuration and resource changes. If it can handle the configuration change, it will be notified in “onConfigurationChanged()” else it will be relaunched.

Final Word

Foldable devices are back into action. We may have only a few as of now but the numbers would surely increase in the future. And that’s when developers will be more concerned during app development as they will have to consider the app compatibility for foldable smartphones as well. Dew being a proficient app development company can design and develop a versatile app for you that caters to foldable as well as non-foldable devices’ functionality. Get in touch with us with your project requirements here.

Originally published at https://www.dewsolutions.in on July 27, 2021.

--

--

Manish Barthwal
Dew Solutions

Passionate writer with a keen interest in Technology