0% found this document useful (0 votes)
19 views2 pages

Units of Measurements

The document discusses different units of measurement used when specifying sizes for elements in an Android UI including dp, sp, pt, and px. It also lists screen densities such as ldpi, mdpi, hdpi, and xhdpi and their corresponding DPI measurements.

Uploaded by

sreeja
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
19 views2 pages

Units of Measurements

The document discusses different units of measurement used when specifying sizes for elements in an Android UI including dp, sp, pt, and px. It also lists screen densities such as ldpi, mdpi, hdpi, and xhdpi and their corresponding DPI measurements.

Uploaded by

sreeja
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 2

Units of Measurement

When you are specifying the size of an element on an Android UI, you should
remember the following units of measurement.

Sr.No Unit & description

1 dp
Density-independent pixel. 1 dp is equivalent to one pixel on a 160 dpi
screen.

2 sp
Scale-independent pixel. This is similar to dp and is recommended for
specifying font sizes.

3 pt
Point. A point is defined to be 1/72 of an inch, based on the physical
screen size.
4 px
Pixel. Corresponds to actual pixels on the screen.

Screen Densities
Sr.No Density & DPI

1 Low density (ldpi)


120 dpi

2 Medium density (mdpi)


160 dpi

3 High density (hdpi)


240 dpi

4 Extra High density (xhdpi)


320 dpi

You might also like