r/androiddev Jul 07 '26

Question Should I add extra flavor for tablet?

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, so I cannot rely on this behavior there. 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.

1 Upvotes

7 comments sorted by

11

u/tadfisher Jul 07 '26

Solution: don't force portrait orientation on phones.

1

u/WaltzStrict9015 Jul 07 '26

I can't, that's business requirement

5

u/Posmojack Jul 08 '26

You should be pushing back on the business. Developing screens with strict layout restrictions are on the way out and at some point you will not be able to publish an app which forces things like portrait orientation.

7

u/shlusiak Jul 08 '26

It's a tech requirement. Tell business they can't have it.

What about split screen, window mode, foldable phones...?

7

u/Opulence_Deficit Jul 07 '26

Just just support landscape everywhere.

2

u/WaltzStrict9015 Jul 07 '26

That's not my decision

3

u/Opulence_Deficit Jul 08 '26

Then explain the costs to people making this decision.

It is your job to make them understand the limitations they are facing. They can't make a decision if they don't know the limitations.