Microsoft Suggests Foldables Need their Own API

The Edge browser team at Microsoft says adjusting its app for devices that fold might be better handled with an API. The recommendation comes ahead of the market debut of high-visibility folding phones from Huawei and Samsung.

The Huawei Mate X features a screen that bends around to cover both sides of the phone, while the Samsung Galaxy Fold opens like a book to reveal a larger display within. Both phone companies have worked directly with developers to customize apps for this fresh form factor, though it's unclear how successful those efforts have been to date. 

Microsoft's team specifically announced the Windows Segments Enumeration API, which will target web browser functionality on bendy screens. The base-level goals are to "effectively layout the content in a window that spans multiple displays" and to " React when areas of that window are occluded by the OS, for example when soft keyboard pops up."

As it stands now, there are a number of hurdles to jump when developing for folding displays. For example, differences in hardware mean some phones will have no seam between screen segments while others will have a hard edge in between segments. Then there's the issue of occlusion, where parts of the phone User Interface cover or otherwise interfere with the content underneath. Further, developers would like to have a way to futureproof against this form factor in the event it becomes popular and they need to adjust more apps in rapid fashion. 

Microsoft points out that there are several APIs already out there that could help, including the Presentation API, Screen Enumeration API, and Windows Placement API. The proposed Windows Segments Enumeration API appears to pick and choose portions of these APIs to form a separate, but complementary alternative. 

"We propose a new concept of Window Segments that represent the regions (and their dimensions) of the window that reside on separate (adjacent) displays," said Microsoft. "Window Segment dimensions are expressed in CSS pixels and will be exposed via a JavaScript API that allows developers to enumerate segments, including about regions that are occluded."

What's not clear is how this will work with Google's own support for folding screens. The company already has tools in Android 10 (API level 29) that address common issues with folding screens, such as handling alternative aspect ratios, window sizes, and app continuity.

Google has not responded publicly to Microsoft's proposal.

Be sure to read the next Mobile article: Google Deprecates Android AsyncTask API