Friday, March 14, 2025
HomeMobile app developmentModifications to orientation and resizability APIs in Android 16

Modifications to orientation and resizability APIs in Android 16



Modifications to orientation and resizability APIs in Android 16

Posted by Maru Ahues Bouza – Director, Product Administration

With 3+ billion Android gadgets in use globally, the Android ecosystem is extra vibrant than ever. Android cellular apps run on a various vary of gadgets, from telephones and foldables to tablets, Chromebooks, automobiles, and most just lately XR. Customers purchase into a whole gadget ecosystem and anticipate their apps to work throughout all gadgets. To thrive on this multi-device surroundings, your apps have to adapt seamlessly to totally different display sizes and kind elements.

Many Android apps depend on consumer interface approaches that work in a single orientation and/or prohibit resizability. Nevertheless, customers need apps to make full use of their giant screens, so Android gadget producers added well-received options that override these app restrictions.

With this in thoughts, Android 16 is eradicating the power for apps to limit orientation and resizability on the platform stage, and shifting to a constant mannequin of adaptive apps that seamlessly modify to totally different display sizes and orientations. This variation will cut back fragmentation with habits that higher meets consumer expectations, and improves accessibility by respecting the consumer’s most popular orientation. We’re constructing instruments, libraries, and platform APIs that will help you do that to offer a constantly glorious consumer expertise throughout your entire Android ecosystem.

What’s altering?

Beginning with Android 16, we’re phasing out manifest attributes and runtime APIs used to limit an app’s orientation and resizability, enabling higher consumer experiences for a lot of apps throughout gadgets.

These adjustments will initially apply when the app is operating on a big display, the place “giant display” signifies that the smaller dimension of the show is larger than or equal to 600dp. This consists of:

    • Inside shows of huge display foldables
    • Tablets, together with desktop windowing
    • Desktop environments, together with Chromebooks

The next manifest attributes and APIs shall be ignored for apps concentrating on Android 16 (SDK 36) on giant screens:

Manifest attributes/API Ignored values
screenOrientation portrait, reversePortrait, sensorPortrait, userPortrait, panorama, reverseLandscape, sensorLandscape, userLandscape
setRequestedOrientation() portrait, reversePortrait, sensorPortrait, userPortrait, panorama, reverseLandscape, sensorLandscape, userLandscape
resizeableActivity all
minAspectRatio all
maxAspectRatio all

There are some exceptions to those adjustments for controlling orientation, side ratio, and resizability:

    • As talked about earlier than, these adjustments will not apply for screens which might be smaller than sw600dp (e.g. most telephones, flippables, outer shows on giant display foldables)

Additionally, customers have management. They’ll explicitly opt-in to utilizing the app’s default habits within the side ratio settings.

Two hands hold a folding phone, showing the Developer News feed in both the folded and unfolded states. The unfolded view shows more news items.

Apps, concentrating on API stage 36, that have been beforehand letterboxed on giant display gadgets will fill the show in panorama orientation on Android 16

Prepare for this alteration, by making your app adaptive

Apps might want to help panorama and portrait layouts for window sizes within the full vary of side ratios that customers can select to make use of apps in, as there’ll not be a solution to prohibit the side ratio and orientation to portrait or to panorama.

To check in case your app shall be impacted by these adjustments, use the Android 16 Beta 1 developer preview with the Pixel Pill and Pixel Fold sequence emulators in Android Studio, and both set targetSdkPreview = “Baklava” or use the app compatibility framework by enabling the UNIVERSAL_RESIZABLE_BY_DEFAULT flag.

For present apps that prohibit orientation and side ratio, these adjustments might end in issues like overlapping layouts. To unravel these points and meet consumer expectations, our imaginative and prescient is that apps are constructed to be adaptive, to offer an optimum expertise whether or not somebody is utilizing the app on a cellphone, foldable, pill, Chromebook, XR or in a automobile.

Resolving frequent issues

    • Keep away from stretched UI elements: If layouts have been designed and constructed with the belief of cellphone screens, then app performance might break for different side ratios. For instance, if a structure was constructed assuming a portrait side ratio, then UI components that fill the max width of the window will seem stretched in landscape-oriented home windows. If layouts aren’t constructed to scroll, then customers might not be capable of click on on buttons or different UI components which might be offscreen, leading to complicated or damaged habits. Add a most width to elements to keep away from stretching, and add scrolling to make sure all content material is reachable.
    • Protect state throughout when window measurement adjustments: Eradicating orientation and side ratio restrictions additionally signifies that the window sizes of apps will change extra regularly in response to how the consumer prefers to make use of an app, equivalent to by rotating, folding, or resizing an app in multi-window or free-form windowing modes. Orientation adjustments and resizing will end in Exercise recreation by default. To make sure a very good consumer expertise, it’s vital that app state is preserved by way of these configuration adjustments in order that customers don’t lose their place within the app when altering posture or altering windowing modes.

To account for various window sizes and side ratios, use window measurement lessons to drive structure habits in a approach that doesn’t require device-specific customizations. Apps must also be constructed with the belief that window sizes will regularly change. It’s not vital to construct duplicate orientation-specific layouts – as an alternative, guarantee your present UIs can re-layout nicely it doesn’t matter what the window measurement is. When you’ve got a landscape- or portrait-specific structure, these layouts will nonetheless be used.

Optimizing for window sizes by constructing adaptive

When you’re already constructing adaptive layouts and supporting all orientations, you are arrange for fulfillment as your app shall be ready for every of the gadget sorts and windowing modes your customers need to use your app in and these adjustments ought to have minimal impression.

We have additionally acquired a spread of testing assets that will help you assure reliability. You possibly can automate testing with instruments just like the Espresso testing framework and Jetpack Compose testing APIs.

FlipaClip is a good instance of why constructing for a number of form-factors issues: they noticed 54% progress in pill customers within the 4 months after they optimized their app to be adaptive.

Timeline

We perceive that the adjustments are important for apps which have historically solely supported portrait orientation. UI points like buttons going off display, overlapping content material, or screens with digital camera viewfinders might have changes.

That will help you plan forward and make the required changes, right here’s the deliberate timeline outlining when these adjustments will take impact:

    • Android 16 (2025): Modifications described above would be the baseline expertise for big display gadgets (smallest display width > 600dp) for apps that concentrate on API stage 36, with the choice for builders to opt-out.
    • Android launch in 2026: Modifications described above would be the baseline expertise for big display gadgets (smallest display width >600dp) for apps that concentrate on API stage 37. Builders won’t have an choice to opt-out.
Goal API stage Relevant gadgets Developer opt-out allowed
36 (Android 16) Massive display gadgets (smallest display width >600dp) Sure
37 (Anticipated) Massive display gadgets (smallest display width >600dp) No

The deadlines for concentrating on a particular API stage are app retailer particular. For Google Play, the plan is that concentrating on API 36 shall be required in August 2026 and concentrating on API 37 will be required in August 2027.

Making ready for Android 16

Seek advice from the Android 16 adjustments web page for all adjustments impacting apps in Android 16, in addition to extra assets for updating your apps in case you are impacted. To check your app, obtain the Android 16 Beta 1 developer preview and replace to targetSdkPreview = “Baklava” or use the app compatibility framework to allow particular adjustments.

We’re dedicated to serving to builders embrace this new period of adaptive apps and unlock the complete potential of their apps throughout the varied Android ecosystem. Try the do’s and don’ts for designing and constructing throughout a number of window sizes and kind elements, as nicely the right way to take a look at throughout the number of gadgets that your app shall be utilized in.

Keep tuned for extra updates and assets as we method the discharge of Android 16!



Supply hyperlink

RELATED ARTICLES

Most Popular

Recent Comments