26 Jun 2015

More details about px, dip, dp and sp units in Android

1) px = dp * ( dpi / 160 )
2) px is one pixel.
3) sp is scale-independent pixels.
4) sp for font sizes
5) dip is Density-independent pixels.
6) dip for everything else, where dip == dp
7) 100*100 px image for mdpi
8) 150*150 px image for hdpi
9) 200*200 px image for xhdpi
10) 1080x1920    save it in “drawable-xxhdpi” folder
11) 480x800      save it in “drawable-hdpi” folder
12) 320x480      save it in “drawable-mdpi” folder
13) 1280x720     save it in “drawable-xhdpi” folder
14) If running on mdpi device, 150x150 px image will take up 150*150 dp of screen space.
15) If running on hdpi device, 150x150 px image will take up 100*100 dp of screen space.
16) If running on xhdpi device, 150x150 px image will take up 75*75 dp of screen space.

No comments:

Post a Comment