this article by Purplesword (jzj1993) original, reprint please specifyOriginal URL http://blog.csdn.net/jzj1993
1.px = Pixels, pixel value
2.DP = Dip = device independent pixel, unit independent pixel (Android dedicated virtual pixel unit)
3.density, screen density
(1) approximate conversion relationship px = dip*density, dip = px/density
(2) the same pixel value (px) of the control, on different density screen, the display effect is large, so the control size is usually defined with a dip
4.densityDpi, how many px pixels per inch
(1) The value is an approximate value. such as Huawei Glory 3c,1280*720 pixels, diagonal pixels about 1468.6, diagonal actual size of 5 inches, the actual dpi of about 294, while the measured densitydpi value of
(2) Most phone screens use square pixels, with the same horizontal and vertical dpi
(3) depending on the size of the densitydpi, decide which folder to call the picture resource under: ldpi is 120dpi,mdpi is 160dpi,hdpi is 240dpi,xhdpi is 320dpi
(4) Conversion Relationship density = densitydpi/160, for the densitydpi screen, density = 1, at which px = Dip
5. Resolution: px pixels per inch in dpi (but often inaccurate to refer to the total number of pixels in the image)
6.sp = scaled pixels, for font size
7.scaledDensity Text zoom factor
(1) conversion relationship: SP = px/scaleddensity, px = sp* scaleddensity
Android Screen Size related knowledge