One, pixel (px) and screen resolution
1)
on the development of the application, the screen resolution is not used.
3) Screen resolution is wide * high, but it is not the size of the screen It is related to the number of pixels in a screen.
II, dpi
1 ) DPI : pixels per inch, is the screen pixel ( px ) The unit of density. Pixel density is the number of pixels that the screen specifies to be displayed within the physical wide range.
2) inAndroidin whichDPIhave the following classifications,ldpi,mdpi,hdpi,xhdpi,xxhdpi,xxxhdpi
3in reality, it is common tomdpias a benchmark, it represents160dpi, and defines this density as1unit of density. 160dpirepresents the1square inches of area have160*160pixel points. ldpiis the120dpi,hdpiis the240dpi,xhdpiis the320dpi,xxhdpiis the480dpi,xxxhdpiis the640dpi, which meansldpithe density is0.75,hdpithe density is for1.5,xhdpiis the2,xxdpiis the3,xxxhdpiis the4.
4 ) DPI regardless of the size of the screen, it is just a measure of the pixel density.
Third, DP
A unit of measure independent of the physical density, which160dpias a benchmark, regardless of theDPIunder the screen,1DPthe physical length of the representation is the same. In the160dpiunder the screen,1DP=1px, which is aDPneed to use apxto indicate that in240dpiunder the screen,1DP=1.5px, which represents aDPneed to1.5apxto express. Which means1DP=DPI/ the*px. It is meant to enable developers to developDPIThe display size is the same under the ShieldUI . that is, in the same size, but different resolution of the phone, with the DP logo, the size of the display is the same.
Four, Dip
with the DP same
V, SP
scaled pixels The abbreviation for the magnified pixel, is specifically designed to handle the size of the font. It is not only related to screen dpi, but also to the system's default font size. For the same SP value, the higher the screen dpi, the smaller the font is displayed; The larger the system font, the larger the font is displayed . That's why all the fonts that use the SP have changed since we set the system font size.
Size measurement units (px, DPI, DP, dip, SP) for Android app Development view