I want that all the views have a fixed size in mm on any device.
I have defined just one layout variant: 320x480 scale 1
I have a button with an height of 40dip
Because "scale1" should mean 160dip per inches, 40 dip means 25.4x40/160=6.35mm
Running this on a device that really has 320x40 scale 1, the button height is really about 6.3mm
Running this on another device that has scale 2, I would expect to measure 12.7mm but i see instead about 8mm
I have tryed many methods to read by code the scale of the device and the result was always 2.
So, it seems the rule of 160dip per inches is not true for different scale than 1
Also tested on another device with scale 1.5 and not correspond.
So, I need a method that allow me to have always 6.35 mm of button height (and all other views the problem exists) on any device. How to do ?
Marco
I have defined just one layout variant: 320x480 scale 1
I have a button with an height of 40dip
Because "scale1" should mean 160dip per inches, 40 dip means 25.4x40/160=6.35mm
Running this on a device that really has 320x40 scale 1, the button height is really about 6.3mm
Running this on another device that has scale 2, I would expect to measure 12.7mm but i see instead about 8mm
I have tryed many methods to read by code the scale of the device and the result was always 2.
So, it seems the rule of 160dip per inches is not true for different scale than 1
Also tested on another device with scale 1.5 and not correspond.
So, I need a method that allow me to have always 6.35 mm of button height (and all other views the problem exists) on any device. How to do ?
Marco