2

Android support different units of measures:

  • dp
  • sp
  • px
  • pt
  • mm
  • in

They recommend using dp for layout and sp for font size.

Can someone point me to a use case where I should be using one of those: px, pt, mm and in ?

morfioce
  • 1,107
  • 2
  • 9
  • 12
  • For building a resolution and density independent app, you don't need `px`, `pt`, `mm` and `in`. Because they are directly depended on the screen's dimension and on it's density. – frogatto Sep 13 '15 at 12:32

1 Answers1

0

Here you have similar question with detailed answers.

Pixels, inches, millimeters and points are units which will be differently displayed on different screens. Screen resolutions can vary between 240x320px and 2560x1600, even with similar screen size and vice versa. Use them only when you absolutely have to (e.g. ruler app).

Community
  • 1
  • 1
michal3377
  • 1,394
  • 12
  • 19