What is the difference between the units of measure
px, dip, dp, and sp?
Android – Difference Between px, dip, dp, and sp
androidandroid-layoutdimensionunits-of-measurementuser-interface
androidandroid-layoutdimensionunits-of-measurementuser-interface
What is the difference between the units of measure
px, dip, dp, and sp?
Best Answer
From the Android Developer Documentation:
From Understanding Density Independence In Android:
0.5 x 0.5 in
0.5 in * 120 dpi = 60x60 px
0.5 x 0.5 in
0.5 in * 160 dpi = 80x80 px
0.5 x 0.5 in
0.5 in * 240 dpi = 120x120 px
0.5 x 0.5 in
0.5 in * 320 dpi = 160x160 px
0.5 x 0.5 in
0.5 in * 480 dpi = 240x240 px
0.5 x 0.5 in
0.5 in * 640 dpi = 320x320 px
More info can be also be found in the Google Design Documentation.