Should I add extra flavor for tablet?


I am an Android developer, and I have a problem with screen orientation.

For phones, the app should only support portrait orientation. However, using

android:screenOrientation="portrait"

in the Manifest is deprecated for large screens. This means that on Android 16+, it will be ignored for wide screens. That is exactly what I want: adaptive orientation for tablets, but portrait-only orientation for phones.

The problem is that we also support Android 11 through Android 15. If I use this attribute, it will break adaptive orientation on tablets.

I had an idea to split phone and tablet into separate builds. One Manifest, for phones, would have this attribute, while the other Manifest, for tablets, would not.

My questions are: Is this a good idea? Is it more expensive from a CI/CD perspective? Will it be harder to publish on the Play Store?

I was told that I can handle this at runtime in MainActivity. I tried that, but if the app is opened while the device is in landscape orientation, it is briefly shown in landscape because the Activity is initially created using the device’s current orientation.

Splitting the Manifests solves this problem, but I wonder what the drawbacks are.

2
Jul 7 at 2:28 PM
User AvatarMyProfile
#android#google-play

Accepted Answer

> Is this a good idea?

No not really, what is considered a phone and what is considered a tablet anymore? Is a foldable device a phone or a tablet? Its both IMO so how will you handle that?

Google is pushing hard for adaptive screens for just this reason. Specific build variants will technically work but at the inconvenience to the user having to download the different/correct version

User Avatartyczj
Jul 7 at 3:06 PM
1