Android screen density dpi vs ppi

morfioce picture morfioce · Sep 13, 2015 · Viewed 10.2k times · Source

According to the android documentation, density should be in dpi (dots per inch) and all layout measurement should be in dp.

and using a simple formula android can map dp to actual pixels.

px = dp * (dpi / 160), 
160dpi ~ medium density screen which is the baseline

So why not just use ppi (pixels per inch) to describe screen density ?

Answer

Udi Idan picture Udi Idan · Sep 13, 2015

There is a lot of documentation about this issue, but I think this part is relevant for your question:

Supporting Multiple Screens

Density independence

Your application achieves "density independence" when it preserves the physical size (from the user's point of view) of user interface elements when displayed on screens with different densities.

Maintaining density independence is important because, without it, a UI element (such as a button) appears physically larger on a low-density screen and smaller on a high-density screen. Such density-related size changes can cause problems in your application layout and usability. Figures 2 and 3 show the difference between an application when it does not provide density independence and when it does, respectively.

enter image description here

enter image description here