Android – Units

Written by . Filed under Apps. Tagged . Bookmark the Permalink. Post a Comment. Leave a Trackback URL.

For measurements in the layouts

px number of real pixels. 100px is the same regardless of screen size.

In Inches - based on screen size. That is, it increases or decreases depending on the screen.

mm Millimeters - based on screen size. same as above.

pt points - 1 / 72 part of the above inch. It also increases or decreases depending on the  size of the screen.

dp Density Independent pixel - based on the physical density of the screen.
Assumes that a pixel is a pixel at 160dpi. However, it does not always make the size proportionally correct. You can also use dip.

sp Works like the dp but also takes into account the user’s font settings. This is recommended only to use on fonts.

Post a Comment

Your email is never published nor shared. Required fields are marked *

*
*

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>