Search code examples
androidwidthmeasuredensity-independent-pixel

How to define a line in centimeters in Android


I'm trying to define a line in Android which measure must be 10cm wide. I tried to put the width in mm and inches, but the results weren't satisfactory.

Also, I tried to follow this link: draw square 3x3 cm in Android

Desperately, i tried to measure 10cm in dip on the screen, but not is the same length in all screens

Is there any way to get it?

Thanks


Solution

  • An inch or a mm are unit of linear measurement on a surface, which could be a screen or a piece of paper.I'm strange if the result is not satisfactory for you.See this answer for more details.