Resolution-independentmeasurements help solve this problem.
Android supports all the following units:
• px (pixels): Dots on the screen.
• in (inches): Size as measured by a ruler.
• mm (millimeters): Size as measured by a ruler.
• pt (points): 1/72 of an inch.
• dp (density-independent pixels): An abstract unit based on the density of the screen. On a display with 160 dots
per inch, 1dp = 1px.
• dip: Synonymfor dp, usedmore often in Google examples.
• sp (scale-independent pixels): Similar to dp but also scaled by the user’s font size preference.
To make your interface scalable to any current and future type of display, I recommend you always use the sp unit
for text sizes and the dip unit for everything else. You should also consider using vector graphics instead of bitmaps
(see Chapter 4, Exploring2D Graphics, on page 70).
From Hello-Android Page 52