How to develop apps for foldable phones?
The foldable devices will certainly require developers to develop apps that offer multiple screen sizes and configurations. The foldable devices will pose some real challenges for developers when it comes to screen sizes and UX of the application.
So to start the development of apps for Foldable devices, you need to first look into the design guide as the very first step.
App continuity
Whenever you are folding or unfolding your device, it triggers configuration changes –
smallest screen size
screen size
screen layout
Apps that do not support multi-window can resize itself when a device gets folded or unfolded. However, when any configuration change occurs, the default case destroys the whole activity and then recreates it.
So it becomes important for developers to store the previous state of the application. For this developers can use onSaveInstanceState() and ViewModel object.
Before the activity is destroyed, you can save its state using onSaveInstanceState() and restore it using onCreate() or onRestoreInstanceState().
Multi-window
As you all may know, there are two types of multi-window –
Split view
Freeform window
In normal devices, the split view can hold two apps at the same time. Whereas, Samsung Galaxy Fold supports 3 split views.
The foldable devices also enhance the functionality of the freeform window. Thus it becomes important for developers to utilize multi-window to make the best use of the foldable screen.
Multi-resume
In the earlier versions of Android, multi-window support only one app active at a time. The other app will be paused when it not active.
Android Pie offered the support of multi-resume functionality but it was up to the app developers and OEM’s (Original Equipment Manufacturer) whether to opt-in or not.
So we can expect Android Q will offer multi-resume as a mandatory behavior.
To make your app multi-resume, you have to set the manifest flag so that it can keep the app in the resumed state.
Read More













