In the past month, LG and Samsung have both released handsets that offer fairly unique aspect ratios. As companies start to push the bezel-less boundaries over the next few years, app developers will most likely want to take advantage and present their apps in the best way possible. Today, the Android Developers Blog has highlighted how to code apps to take advantage of these expanded screen ratios.
Now, in order to scale apps to the newer formats that are arriving, the blog recommends developers adjust the maximum supported ratio in their apps.
This can be done by:
Simply declaring an android.max_aspect
element in the app's element:
Where ratio_float is the maximum aspect ratio your app can support, expressed as (longer dimension / shorter dimension) in decimal form.
We recommend that you design your app to support aspect ratios of 2.1 or higher. For this, you would add the following to the
These values will need to be changed due to the existing default that is set roughly to a 16:9 aspect ratio. Both the LG G6 and Samsung Galaxy S8 and S8+ will arrive next month. LG's will offer an 18:9, while Samsung's will offer an 18.5:9 aspect ratio.
Source: Android Developers Blog