Inconsistent resolutions on devices with Software Controls

I am making a game with MonoGame.Android using Xamarin.

I have found that devices with Software controls (highlighted here in red) give inconsistent resolutions.

Specifically, the issue occurs for apps that are authored in Landscape Orientation but opened while the phone is in Portrait Orientation. When you do this, the phone ignores the physical orientation of the phone and renders in Landscape mode regardless.

For example, I have created an emulator for Samsung Galaxy S2. I cloned 2 copies, 1 with software controls (S2Soft), and the other with hardware controls (S2Hard). I started my app on both phones while in both portrait orientation and landscape.

In Game.Initialize I check the values for PreferredBackBufferWidth and PreferredBackBufferHeight. Here is what I found:


  • Portrait: 736x480
  • Lanscape: 744x480


  • Portrait: Res: 800x480
  • Landscape: Res: 800x480

Now, I understand that S2Soft may have a smaller resolution compared to S2Hard (in order to make room for the software buttons), I don’t understand why S2Soft has two different resolutions depending on the orientation of the phone at startup.

Has anyone dealt with this before? This is an issue for me because my UI is placed based on those resolutions, and if someone starts the app in portrait mode, that are placed incorrectly. It also leaves thin lines on the sides of the screen where the backbuffer is not being rendered.

Here is an example of the thin bars (the blue bars at the top and bottom are not there if started in landscape mode).


Answered by own question here:

tl;dr: I wasn’t setting my activity orientation to landscape which caused the switch to happen later.

ScreenOrientation = Android.Content.PM.ScreenOrientation.Landscape