Detecting software kind – The right way to know if a tool is foldable or a pill – CLP World(Digital)
Home Mobile Detecting software kind – The right way to know if a tool is foldable or a pill

Detecting software kind – The right way to know if a tool is foldable or a pill

Detecting software kind – The right way to know if a tool is foldable or a pill


Posted by means of Alex Vanyo, Developer Family members Engineer

With the rise in Android apps getting used on huge display kind components like foldables and pills, an increasing number of apps are development totally adaptive UIs. See Give a boost to other display sizes for best possible practices for updating your app for best possible practices for updating your app. The secret is that Structure and app conduct must be in line with software configuration and to be had options, and no longer the bodily form of the software.

On the identical time, we get this query so much: “Is there a very simple technique to inform if a tool is a foldable, pill, or one thing else?”

It would appear that the use of the bodily form of software supplies all of the knowledge builders want to create nice reviews. Then again, we will be able to make extra adaptive apps with a greater person enjoy by means of including extra context. For instance:

  • Do you wish to have “turn”-style telephones to rely as foldables?
  • Do you wish to have to decide if a tool is a pill, or simply if mobile capability is to be had?
  • What would rollables rely as? What about ChromeOS units, or different desktop units that may run Android apps?

The most typical explanation why app builders need to know the kind of the software is so they may be able to decide what sort of structure to turn. However with the rise of split-screen and multi-window utilization on huge monitors, making structure choices in line with software kind ends up in improper structure choices in positive eventualities on huge display units.

As we’ve been updating our personal apps to higher improve extra units, we’ve got observed a couple of necessary use instances to spotlight additional. We can quilt 4 primary eventualities:

  1. Layouts – Show probably the most suitable UI for various units and folding postures
  2. {Hardware} options – Put into effect improve for plenty of {hardware} options
  3. Exhibiting the title of the bodily software kind to the person – Personalize end-user dealing with knowledge for the kind of software.
  4. Metrics monitoring for software kind – Know how customers are the use of your app on various kinds of units



Show probably the most suitable UI for various units, show modes, and folding postures.


Use window length categories to lead structure choices in line with your present windowing state the use of opinionated breakpoints which are derived from commonplace software varieties. Do not limit orientation or resizability; you save you customers from the use of your software of their desired means.

Follow folding options with Jetpack WindowManager, which gives the set of folding options that intersect your app’s present window. Be aware that even supposing your process isn’t receiving any folding options, it might nonetheless be operating on a tool in a position to folding – at the outer display, at the inside display in a small window, or on an exterior show.


Traditionally, more than one distinct layouts have been created for various display sizes, incessantly with a “pill” structure and a “telephone” structure. Those two layouts then existed in combination, and each needed to be saved up to the moment because the app modified. Referring to those layouts as “pill” and “telephone” layouts was once helpful when the software producers by means of and big restricted themselves to creating units that are compatible cleanly into those two classes. Customers as of late have much more selection as producers are growing units which are extra bodily various, and usable in numerous tactics.

A unmarried software might now and again have sufficient room to show a “pill”-sized structure, whilst different instances (as an example, a folded foldable or break up display) the software might best have sufficient room to show a “telephone” structure. There are even instances the place a smaller structure is desired comparable to foldable turn telephone quilt shows.

This may well be because of a foldable that has a smaller outer display and a bigger inside display, or on every occasion the person enters multi-window mode and adjusts freeform windowing environments. Significantly, the kind of app structure must no longer be made up our minds by means of the bodily form of the software; it must be made up our minds by means of the present length of the app’s window, which might or is probably not complete display at the present software show.

On huge display units operating Android 12L and better, apps that limit the orientation or resizability may also be positioned into compatibility mode because the software is turned around or folded or the app enters multi-window mode. Compatibility mode letterboxes the app, conserving the app’s specified restrictions, however lacking the chance to show extra, helpful content material to the person.

{Hardware} options


Put into effect improve for plenty of {hardware} options (as an example, if the software has a SIM).


Make dynamic, runtime choices in line with whether or not a characteristic is to be had, as an alternative of assuming {that a} characteristic is or isn’t to be had for a definite more or less software.

In case your app has a characteristic this is completely required, Google Play respects the desired uses-feature declarations for your manifest. Then again, keep in mind that any required options cut back the set of units that your app may also be put in on, and including new required options prevents updates to up to now supported units.


There are lots of {hardware} options which are provide on some Android units, however no longer provide on others. As units proceed to conform, we’ve observed more than one instances the place user-facing options don’t seem to be supported, as a result of builders suppose {that a} bodily form of software doesn’t improve a selected {hardware} characteristic.

For instance, we’ve observed instances the place biometric authentication isn’t introduced as a login choice on pills that improve biometric authentication, even if the similar app helps biometric authentication on telephones. Biometric authentication must be an choice for the person if the software helps it, no longer in line with the kind of software.

Some other instance is assuming mobile connectivity is restricted to standard-size telephones. Foldable units would possibly have “pill”-sized monitors, however foldables nonetheless have a mobile connection and a telephone quantity. If a tool has the potential, the person must be ready to make a choice to make use of the software accordingly.

Some {hardware} options also are dynamically to be had. Peripherals could be connected and indifferent by means of the person, and apps must gracefully take care of gaining and shedding get admission to to those options. {Hardware} options just like the digital camera and microphone can best be utilized by one app at a time, so multi-tasking between other apps might also lead to shedding get admission to to {hardware} options.

Exhibiting bodily software kind to the person


Personalize user-facing knowledge by means of form of software (as an example, “Run to your pill”)


Referring within the UI to the person’s software as merely a “software” covers all kind components and is the most straightforward to put into effect. Then again, differentiating between the more than one units a person could have supplies a extra polished enjoy and lets you show the kind of the software to the person the use of heuristics related for your explicit use case.

For instance, Google Play recently makes use of the next heuristics for figuring out the software title to show to the person when putting in an app on a selected software. The common sense is particular to this actual use case, and might trade as units and kind components evolve.

Chart showing Google Play Device Display Names as of June 2023. If the device has all built-in display(s) screen width less than 600dp with or without a hinge, it's considered a phone. When the device has built-in display with screen width greater than or equal to 600dp, if it has a hinge it is considered a foldable, and without a hinge it is considered a tablet.
Google Play Software Show Title common sense as of June 2023


If you’re showing the kind of the software to the person, and need to differentiate between the bodily form of the software for personalizing the enjoy, comparable to to mention “obtain to your foldable” or to turn extra explicit software imagery, you’ll use the to be had bodily options as heuristics for which form of software the person is the use of. Then again, those are best heuristics and may just trade because the permitted phrases for relating to the units themselves trade. As mentioned above, a foldable software might or won’t improve different {hardware} options, or have a big display.

“Foldable” heuristic:

If a tool has a hinge sensor (which may also be made up our minds by means of PackageManager.hasSystemFeature(PackageManager.FEATURE_SENSOR_HINGE_ANGLE)), then the software helps folding in some means. Be aware: Whilst this covers maximum foldables shifting ahead, it won’t quilt some older foldables that don’t disclose a hinge sensor. Moreover, the display the app is being displayed on might or won’t fold, the software would possibly have an extra non-folding display as neatly, or the display won’t recently be folded, even supposing it might fold. Units just like the Samsung Turn have a smallest width of lower than 600dp, The internal display of large-screen foldables have a smallest width of 600dp or extra.

“Telephone” heuristic:

99.96% of telephones have a integrated display with a width smaller than 600dp when in portrait, however that very same display length may well be the results of a freeform/split-screen window on a pill or desktop software.

“Desktop” heuristic:

Desktop units, like ChromeOS units, operating Android apps, might disclose explicit options or setting knowledge that apps can use. For example, ChromeOS has the device characteristic “org.chromium.arc” or “org.chromium.arc.device_management” to permit builders to decide whether or not their app is operating on ChromeOS. However apps operating on pills – and telephones, if the person so chooses – might also use desktop-class keyboards and mice for enhanced productiveness.

Metrics monitoring for software kind


Know how customers are the use of your app on various kinds of units.


Use the heuristics and contours mentioned above as inputs for your analytics, whilst protecting in thoughts that bodily software kind doesn’t give your entire tale for the way customers are the use of your app on that software.


Although the person is the use of a tool that may bodily fold, they could also be the use of the app in more than one configurations. Customers would possibly use an app roughly at the inside display in comparison to the outer display, and they would multi-task with different apps at the inside display. For units that improve exterior shows, the app will not be operating on both of a foldable’s integrated bodily shows.

Different knowledge that may also be related:

  • Are there exterior peripherals getting used to engage with the app, like keyboards, mice, trackpads, or styluses?
  • Does the software have a integrated touchscreen?
  • Is the app being utilized in a free-form windowing setting?


Are not making assumptions about what a selected bodily software implies in your app. “Is the software foldable?” is a superb place to begin, however it shouldn’t be the one query you ask. Further items of knowledge will give a extra actual and extra related resolution for your use case to hand, and every use case has other concerns that you just must make to construct flexible, adaptive apps.



Please enter your comment!
Please enter your name here