Incorrect xdpi and ydpi for some Motorola devices

I am trying to estimate the xdpi and ydpi values ​​for Motorola Droid2 global and Motorola Atrix to calculate screen width. These are the values ​​that I get.

Atrix: Resolution: 540 * 960 xdpi: 160 ydpi: 160 the estimated width of the screen approaches 6.1, while the original value is 4

Droid 2: Resolution: 480 * 854 xdpi: 144 ydpi: 144 the calculated screen width is close to 6.9, while the original value is 4.

The same width calculation logic works great with Xoom, HTC, samusng phones and some other Android devices. In these cases, xdpi and ydpi are reported to be around 240

Values ​​144 and 160 are correct values?

If this is the wrong approach, any idea how we can calculate the screen width programmatically?

+3
source share

All Articles