Monday, September 25, 2017
DPI settings and Android N
DPI settings and Android N
Ever since I owned a Samsung Galaxy Mega 6.3 a few years ago, with its low DPI setting (i.e. everything looks smaller on the screen) I have been keen on changing the default DPI on phones with large displays - notably the Samsung Galaxy Note series, which I have used as my main device more than any other model.
DPI
The DPI setting of the device is held in the build.prop file, which is present in the system folder in the root of the phone. The build.prop file contains many global settings for the phone, including the DPI, which affects how things are scaled on the screen. The DPI setting is defined by the following property:
ro.sf.lcd_density = xxx
A larger DPI value will make everything larger on the display, and vice versa.

The image above shows my Samsung Galaxy Note 4 homescreen. This is running at a DPI setting of 480, compared with the default setting of 640. It should be noted that the launcher used is the Google Now launcher, but the row and column count have been changed with Xposed GEL Settings, which is a module for the Xposed framework (Samsung specific link).
Unfortunately, accessing and modifying this setting requires root access, which means that its not something you can do out of the box.
Android N
With Android N there is rudimentary DPI modification built right into the OS. This is a boon for devices such as the 6" Nexus 6 and even the 5.7" Nexus 6P (which is actually my sweet spot for device size)
To change the DPI on Android N you need to go to Settings / Display / Display Size. Here you will be given the choice of Small, Default, Larger or Largest. These equate to around 85% to 150% zoom, depending on the device.
To be honest, I would personally prefer there to be a Very Small option, as I think this would be more usable than the extreme Largest setting. Never the less, it is a welcome improvement.
It is actually fairly easy to set a custom DPI, however, via the use of adb:
adb shell wm density <value>
This will add a new item to the menu called Custom, which will allow you to switch to your custom DPI value.
Effect of DPI change
Below are a few images from my Nexus 9 to show the effect of the DPI change. In all cases we are comparing the Default value to the Small value:
Home Page


The icon layout is identical, but the notification panel is smaller.
eMail (Outlook)


Outlook scales very well with the DPI change, displaying more content in both the mailbox and preview panes.
Google Chrome


Asides from the chrome around the window, the actual content of the browser doesnt change.


Twitter responds well to the DPI change, displaying more information on screen.
YouTube


YouTube also scales well.
Settings


The Settings menu scales well, as expected.
Conclusion
Building in screen scaling straight into the core of the operating system is, in my view, the highlight of the N release for large screened devices.
As we can see, the DPI changes make a noticeable difference to most applications. Hopefully having such an early Developer Preview will mean that any applications which dont respond well to DPI changes will be recoded to support this feature & by the time N is released, the vast majority of apps should behave as expected.
download file now