One, px
Pixels, which is the most basic point for displaying data on the screen.
Second, DPI
DPI (dots per inch): dots per inch, also known as pixel density, that is, screen diagonal pixel value ÷ inch value
For example, 480x800 resolution 4.0-inch mobile phone computing dpi=
Third, DP
DP (same as DIP): 1DP = 1px on a monitor 160 dots per inch, px = DP (dpi/160)
Suppose two screen size, the screen one DPI value is twice times the right, if the screen a DPI of 160, the screen two DPI is 320, set 160DP case
Screen One: 160PX=160DP (160dpi/160) Screen II: 320PX=160DP (320dpi/160)
Depending on the relationship, it can be concluded that:
Screen a control length of 160px, screen two control length of 320px, so that the length of the control to adapt to different screen size, with DP very suitable.
Four, SP
SP (scaled pixels) is typically used to specify the font size, and the font size changes when the user modifies the phone display font
For the UI layout, use DIP/DP as the unit, and if the corresponding font has an SP as the unit, try to use PX as less unit.
Note: The resolution is not related to the screen size, the screen size is physical, and the resolution is the display capability.
More:
Http://www.cnblogs.com/cmduan/archive/2012/03/09/2388345.html
Android: Layout Unit conversions