I have a button with a 10 mm layout that looks correct on most devices, but, for example, on Lg Optimus 2X and on Motorola Defy, the buttons are about half the size:
I got DisplayMetrics information on these devices, and here's a quick overview:
HTC Desire Z: 480x800, density : HIGH, xdpi: 254.0, ydpi: 254.0
Motorola Defy: 480x854, density : HIGH, xdpi: 96.0, ydpi: 96.0
Samsung Galaxy S2: 480x800, density : HIGH, xdpi: 217.71428, ydpi: 218.49463
LG Optimus 2X: 480x800, density : HIGH, xdpi: 160.0, ydpi: 160.0
As you can see, Desire Z and Samsung have a reasonable x / y-dpi value. defy and optimus deliver terribly incorrect values, which I assume are the cause of the wrong size.
Is there any other way around this hardware error than creating separate layout files for these devices?
Or is it recommended not to use mm / inch sizes at all?
source
share