A complete guide of making apps for foldable screens

WRITTEN BY

Pooja Kelodia

Senior Android Developer

First things first, what are foldable screen devices?

Samsung unveiled Galaxy Fold for the first time in September 2019, eight years after debuting a prototype of foldable smartphones. With its top-shelf hardware, sturdy look, and a gripping dual-display experience, there was a raging enthusiasm in the Indian market. Galaxy Fold was sold out twice after pre-bookings in just one month. Though there are certain disadvantages that foldable devices come along with, they surely are flag bearers of flagship devices.

For developing apps that offer multiple screens and configurations, developers need to focus on the screen resolution and size or width of the screen display. Before learning about the factors to consider for developing apps for foldable screens, let's take a look at the advantages of foldable devices.

  • Foldable screens mean a larger workspace for running multiple apps simultaneously. Samsung Galaxy Fold, for example, lets you use Messenger while watching videos on YouTube and browsing the Internet, all in different windows.
  • Compared to a tablet, a smartphone's foldable screen ensures a larger display in a smaller form factor. This works the best for giving a better immersive experience for playing games, watching videos, or just reading stuff. Picturing flipping a foldable smartphone to simply reveal a decent screen sort of seems magical. For people who are always on the move, foldable phones could act as a portable entertainment device.
  • Regardless of whether one goes for a small or a large form factor foldable, the footprint of any device that is going to fit in the pocket gets doubled. For devices with bigger screens, it would be similar to carrying around a tablet everywhere. For clamshell foldables, however, it would just be like carrying a regular sized phone in a package that would be more fitting for your hands, pockets, or bags.
  • Foldable phones also give out an extra sense of protection, as one is more likely to feel safe putting it in a rucksack or a handbag without any bulky case.

Challenges faced by app developers

  • The biggest challenge for the app developers will be to build apps that could adapt to different screen configurations and sizes while maintaining the user experience.
  • For foldable screens, apps can automatically transition between the two screens. For an optimum user experience, the current task has to continue seamlessly between the transitions - the app should be able to resume with the same location and state.
  • With foldable screens, several aspect ratios and alignments will have a higher expectation in terms of quality. The app flow has to be as hassle free for foldable screens as it is, for regular screens.
  • App developer experts will need to develop the apps around a number of test cases to ensure their proper functioning on foldable screens.
  • A hassle-free functioning of apps in foldable screens would require heavy investment in terms of design, development, and testing of the apps. During an app transition, the system triggers a configuration change. Hence, the app should be able to save the UI state while being able to support the configurations changes.

Now that the challenges are covered, here are a few alterations and factors to be considered for developing apps for foldable devices:

  • Make sure your apps are resizable
    Your apps should be able to work with multi-window mode while packing dynamic resizing. This can be done by setting the attribute to resizeableActivity=true. This ensures maximum compatibility regardless of any environment or form factors that the app may encounter, be it for desktop mode, freedom windows, or foldables.
  • Test the app's behavior with a foldable emulator or in a split-screen
    If the app sets false to the resizeableActivity attribute, this informs the platform that it cannot support multi-window. The system might still try to resize the app or place it in a multi-window mode, but this compatibility is implemented by applications of the same configuration for all the components of the app. This includes its services and activities as well. For some cases, a major change like changing a displace size can lead to restarting of the process instead of changing the configuration.
  • New screen ratios
    Android 10 (API level 29) or higher can support a large range of aspect ratios. Form factors for foldables could vary from being extremely high (with thin and long screens, like 21:9 for a folded screen), to extremely low, till 1:1.
  • Multi-resume
    For running on Android 9.0 or the earlier versions, the app in focus will be in the resumed state; all the other activities will get paused. This creates a problem if the apps stop playing content when paused, or they close resources. For Android 10, this doesn't happen, so all the activities can stay in the resumed state if the device is set in multi-window mode. This is known as multi-resume. It should be noted that if there's a transparent activity on the top, the activity can be stopped. This also happens if it's not focusable, like in picture-in-picture mode. Another possibility is that 0 activities have focus at a particular time, like when the notification drawer gets opened. OnStop will keep working per usual and will be called at any point when the activity gets taken off from the screen.
  • Multi-display
    The future might see foldable phones supporting multiple screens or displays simultaneously. This configuration is similar to the one developers now use for projected screens on Chrome OS. With Android 10 (API level 29) or higher, activities on secondary displays are supported. For a device with multiple displays, if there is an activity running, users can easily move it between the displays. Multi-resume is also applicable for multi-screens - numerous activities can get user input simultaneously.
  • Foldable Modes
    All foldable devices either have a hinge with some width or a fold in display which separates the two displays. The ones with a hinge can span content easily behind the hinge, much like how Microsoft Surface Duo works for its spanned mode. Some foldables could be placed in like half-folded configurations. The others could have postures like the ones in Samsung's Flex Mode.
  • Hinge angle
    For Android 11, apps which run on those devices which have hinge-based screen configurations are able to determine the hinge angle. This happens if the sensor of the device with TYPE_HINGE_ANGLE reports a SensorEvent. SensorEvent will monitor the hinge angle and then provide a measurement (in degrees) for the two integral device parts. These raw measurements can be used for performing granular animations as a user will manipulate the device.
  • Testing
    Lastly, to make sure that the app is ready for a foldable, it should be tested to see how it reacts to configuration changes, multi-resume and multi-window, and new screen ratios and resizing.

As tricky as it may look, developing apps for foldable devices is just an add-on to what the app developers are already doing. An in-depth research about all the features of foldable devices that are different from the regular devices should be the starting point of work. This could be followed by studying how they will affect the process of app development, and then it can be taken forward. Getting on-board a professional team for this should help!

Latest Blogs

Top 10 promising tech trends for Android app development

Read More

Node.js versus Java - settling the debate, once and for all

Read More

Why does your business need a mobile app now?

Read More