-1

So I set a block to a width of 367dp and on screen it is 65mm

But according to the documentation 1dp = 1 pixel@160dpi

1 inch = 2.54cm 25.4mm / 160px = 0.15875mm

so 1dp pixel should be 0.15875mm and thus 367dp should be 58.261mm

Is something wrong in my math?

Thanks.

Heetola
  • 5,791
  • 7
  • 30
  • 45

1 Answers1

0

What is the resolution and the size of your screen? This will help you figure out the screen density.

Android use screen density buckets: mdpi, hdpi, x-hdpi, xx-hdpi... The screen sizes of the devices do not fall exactly in one bucket, but I think the system finds the best bucket with the closest dpis.

This is the official documentation for screen densities This medium post can help you figure out how to work for screen densities

As a rule, of thumb, unless there is a strong requirement (showing an object at exact scale on a specific device model), you should try avoiding sticking to millimeters on your design and focus more on building responsive content that fits many screens.

If you really want to measure things:

alaeri
  • 344
  • 3
  • 16
  • Thank I'll look this up. our client sometimes checks with a ruler the app dimensions, it has to be the exact same dimension as what was specified (to the millimeter). this app is only targeted for a single device. – Heetola Oct 25 '19 at 09:10