Android Question 18:9 & 19.5:9 Simulators?

Computersmith64

Well-Known Member
Licensed User
Longtime User
Lately I have been getting feedback from some users with devices running 18:9 (eg: Galaxy S8 & S9) & 19.5:9 (eg: LG G7) aspect ratios that some of the text in one of my apps doesn't fit properly onto the screen.

It's always handy to have a device or simulator with the same specs as the one with the reported issue(s) & I was able to find something to test the 18:9 aspect ratio on, but not the 19.5:9.

Samsung have a service called Remote Test Lab where you can test on real devices via the web at https://developer.samsung.com/remotetestlab/galaxy/rtlDeviceList.action. This works OK sometimes, however I find that often the connection drops or hangs & I have to stop the session, then restart it again - which is annoying.

Does anyone know of any simulators that support 18:9 &/or 19.5:9 aspect ratios?

- Colin.
 

Peter Simpson

Expert
Licensed User
Longtime User
Hello @Computersmith64.
Have you tried the following code in your manifest file?

I read somewhere that adding android.max_aspect and also android:resizeableActivity is the cure to 18:9 up to 2.1 aspects radio issues. I've tried it with my normal phones and all appears normal, I've not tried it with tablets though.

I'm not saying that this will fix your issue 100%, but I did read it on the net some time ago and I did make a note of it, thus my response to your post.
B4X:
AddManifestText(
<uses-sdk android:minSdkVersion="5" android:targetSdkVersion="28"/>
<meta-data android:name="android.max_aspect" android:value="2.1"/>
<supports-screens android:largeScreens="true"
    android:resizeableActivity="false"
    android:normalScreens="true"
    android:smallScreens="true"
    android:anyDensity="true"/>)
SetApplicationAttribute(android:icon, "@drawable/icon")
SetApplicationAttribute(android:label, "$LABEL$")
CreateResourceFromFile(Macro, Themes.LightTheme)

Enjoy...
 
Last edited:
Upvote 0

Computersmith64

Well-Known Member
Licensed User
Longtime User
Hello @Computersmith64.
Have you tried this, I read somewhere that adding android.max_aspect and also android:resizeableActivity is the cure to 18:9 aspects radio issues.
B4X:
AddManifestText(
<uses-sdk android:minSdkVersion="5" android:targetSdkVersion="28"/>
<meta-data android:name="android.max_aspect" android:value="2.1"/>
<supports-screens android:largeScreens="true"
    android:resizeableActivity="false"
    android:normalScreens="true"
    android:smallScreens="true"
    android:anyDensity="true"/>)
SetApplicationAttribute(android:icon, "@drawable/icon")
SetApplicationAttribute(android:label, "$LABEL$")
CreateResourceFromFile(Macro, Themes.LightTheme)

Enjoy...
Thanks Peter - but I also read that if you have the targetsdk set to 24+(?) then resizableActivity defaults to true anyway. I have the targetdsk set to 28, so I'm not sure if this will make any difference - but I'll give it a try. Also, the issue with the 19.5:9 aspect ratio seems to be related to the device's normal font size being larger than other devices. The layout formats OK on the screen, but some of the labels overlap each other.
 
Upvote 0

Computersmith64

Well-Known Member
Licensed User
Longtime User
I also found this on StackOverflow:

The android.max_aspect only makes difference if your android:resizeableActivity is not true. If your app's target API is 24 or higher android:resizeableActivity is set as true.

Note: You do not need to set a maximum aspect ratio if an activity's android:resizeableActivity attribute is set to true. If your app targets API level 24 or higher, this attribute defaults to true. For more information, see Configuring your app for multi-window mode.

Please refer to the documentation.

So it seems that if you set android:resizableActivity to true, then you don't need android.max_aspect - & if the API level is 24+ you don't need to set resizableActivity to true.

It would be great if there was a simulator available that we could test these settings on though...

- Colin.
 
Upvote 0

Peter Simpson

Expert
Licensed User
Longtime User
That's Interesting @Computersmith64, I don't have that information in my notes. When I come across something interesting on the net I takes notes, I must have missed that.

Hmm, you could always try to make an AVD size 1080x2220 for yourself using the Android Emulator included in B4A, you will have to create a batch file and this will be the result.
Screenshot_1538352074.png
 
Last edited:
Upvote 0

Computersmith64

Well-Known Member
Licensed User
Longtime User
I was just looking at the B4A AVD manager & wondering how to customize a device. With the old AVD Manager (the one Google discontinued) you could create varios resolutions, but I don't see how to do this with the B4A one. I also couldn't find anything with a quick search of the forum - can you point me to a thread with details?

- Colin.
 
Upvote 0

Peter Simpson

Expert
Licensed User
Longtime User
@Computersmith64 here is the file that I just created for you. You just have to change the route to your b4x emulator android\tools folder in the batch file, save it and run it. I also updated the screen shot above to match. Hopefully this will work for you, no promises though.

Enjoy...
 

Attachments

  • 6 Inch Phone 2220 x1080 Emulator.zip
    276 bytes · Views: 331
Upvote 0

Computersmith64

Well-Known Member
Licensed User
Longtime User
Thanks Peter - took me a while to get it running due to having a different setup to you, but it's working now so I'll have a play with it...

- Colin.
 
Upvote 0
Top