Enabling Samsung S8 Full Screen mode

Is there anything I need to add to my build.settings file to make the Galaxy S8 launch my app in full screen mode?

My code supports the new aspect ratio, and I can make it work if I go into Settings -> Display -> Full Screen Apps and manually enable full screen for my Corona app.  But by default, the app is listed on that screen as “This app may not work properly in full screen”, and is shown in a kind of letterbox mode.

This Android developer blog post suggests I need to add max_aspect into the Android manifest file, but it wasn’t recognized under 

settings = { android = { max\_aspect = 2.1 } }

in my build.settings file.  I’ve also tried:

settings = { android = { coronaActivityFlags= { resizableActivity = true, } } }

and still no success.  Any thoughts on what I’m doing wrong?

Corona’s build.settings can’t be used to add arbitrary AndroidManifest.xml entries since we have to specifically code them correctly.  resizableActivity has to do with split-screen apps, we we really don’t support. It’s there to force disable them.

To make your app work on the S8 in full screen (I’m assuming you mean no letterbox black areas), you simply have to make sure your background is large enough to conver the full screen and adjust places where you load the background to use the right size.

For instance, most devices are happy with a 16:9 to 4:3 aspect ratio. So for a 320x480 content area, we’ve alway’s recommended a 360x570 background to cover the full range of devices (all values in portrait mode, if it’s a landscape app, adjust accordingly)

But the S8 is a 2:1 aspect ratio which means that background needs to be 360x640. The iPhone X is even more extreme.

Rob

Ahh, it’s more complicated than that, but I got it working. (TLDR: add the code below into build.settings.)

By default, if your app doesn’t specify a max_aspect ratio in the manifest, the Galaxy S8 assumes your app is unoptimized, and crunches it into a letterbox mode. (Google’s Android Developer’s Blog says if max_aspect isn’t specified in the manifest, “the maximum aspect ratio defaults to 1.86 (roughly 16:9) and your app will not take advantage of the extra screen space”.)  On the S8, your app is even labelled with a warning in Settings -> Display -> Full Screen Apps: “This app may not work properly in full screen”.  Your users have to manually toggle a switch to force full screen mode on your app.

But you can make full screen work out of the box!

Fortunately, you can add arbitrary AndroidManifest.xml entries, at least to the Application element (see Android Directives in the Corona Docs).  If you add the max_aspect meta-data element and set it for at least 2.1, the Galaxy S8 understands that your app is optimized for its larger screen, and it won’t crunch your app down and force it to letterbox. You can do this by adding it into build.settings:

settings = { android = { &nbsp; &nbsp; &nbsp; &nbsp; applicationChildElements = &nbsp; &nbsp; &nbsp; &nbsp; { &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; -- Array of strings &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; [[&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; \<meta-data android:name="android.max\_aspect" android:value="2.1"/\> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;]], &nbsp; &nbsp; &nbsp; &nbsp; }, } }

And if you do this, you’ll get a different notice next to your app in the Settings -> Display -> Full Screen Apps screen: “This app is optimised to run in full screen.” As a bonus, you’ll be listed at the top of that screen, with all the official Samsung & Google apps, and others like Uber & OneDrive.  But best of all, your users won’t have to do anything manually to make your app run in full screen, it will work from first launch.

Corona’s build.settings can’t be used to add arbitrary AndroidManifest.xml entries since we have to specifically code them correctly.  resizableActivity has to do with split-screen apps, we we really don’t support. It’s there to force disable them.

To make your app work on the S8 in full screen (I’m assuming you mean no letterbox black areas), you simply have to make sure your background is large enough to conver the full screen and adjust places where you load the background to use the right size.

For instance, most devices are happy with a 16:9 to 4:3 aspect ratio. So for a 320x480 content area, we’ve alway’s recommended a 360x570 background to cover the full range of devices (all values in portrait mode, if it’s a landscape app, adjust accordingly)

But the S8 is a 2:1 aspect ratio which means that background needs to be 360x640. The iPhone X is even more extreme.

Rob

Ahh, it’s more complicated than that, but I got it working. (TLDR: add the code below into build.settings.)

By default, if your app doesn’t specify a max_aspect ratio in the manifest, the Galaxy S8 assumes your app is unoptimized, and crunches it into a letterbox mode. (Google’s Android Developer’s Blog says if max_aspect isn’t specified in the manifest, “the maximum aspect ratio defaults to 1.86 (roughly 16:9) and your app will not take advantage of the extra screen space”.)  On the S8, your app is even labelled with a warning in Settings -> Display -> Full Screen Apps: “This app may not work properly in full screen”.  Your users have to manually toggle a switch to force full screen mode on your app.

But you can make full screen work out of the box!

Fortunately, you can add arbitrary AndroidManifest.xml entries, at least to the Application element (see Android Directives in the Corona Docs).  If you add the max_aspect meta-data element and set it for at least 2.1, the Galaxy S8 understands that your app is optimized for its larger screen, and it won’t crunch your app down and force it to letterbox. You can do this by adding it into build.settings:

settings = { android = { &nbsp; &nbsp; &nbsp; &nbsp; applicationChildElements = &nbsp; &nbsp; &nbsp; &nbsp; { &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; -- Array of strings &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; [[&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; \<meta-data android:name="android.max\_aspect" android:value="2.1"/\> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;]], &nbsp; &nbsp; &nbsp; &nbsp; }, } }

And if you do this, you’ll get a different notice next to your app in the Settings -> Display -> Full Screen Apps screen: “This app is optimised to run in full screen.” As a bonus, you’ll be listed at the top of that screen, with all the official Samsung & Google apps, and others like Uber & OneDrive.  But best of all, your users won’t have to do anything manually to make your app run in full screen, it will work from first launch.

Any updates on that? my app doesn’t cover the entire screen of a Redmi Note 8.

It looks like the Redmi Note 8 viewport is 393x851, so the aspect ratio is 851 / 393 = ~2.166. So you’d need to set your max_aspect to at least 2.2 for it to fill the Redmi Note 8 screen.