Why 2 devices of same size, same resolution, claim

2020-04-07 05:15发布

问题:


Want to improve this question? Update the question so it's on-topic for Stack Overflow.

Closed 2 years ago.

Please take a look at Material IO's device metrics:

Pay attention to Google Pixel and HTC One M9.

These 2 devices have the same physical size, same number of pixels, but claimed to have different pixel densities.

This contradicts with my understanding of pixel density.

Which of the following is true?

  1. My understanding of pixel density is wrong. All information on the page is correct;
  2. The information on the page is wrong;
  3. On HTC One M9, although the screen size is 5.0, a small part of it is not used to display (i.e. Actual display size is smaller than Google Pixel)
  4. Something that I can't imagine

回答1:

A friend gave me an explanation and I think it is very likely to be the correct answer:

The answer is: 4. Something that I can't imagine

(1) The density here is not pixel density. It is dp-density.

If you click on Google Pixel, you will see px/in is 441 which is the same as HTC One M9. This means their pixel densities are the same. And next to this value you see a dp/in which is different among these 2 devices. That correspond to the density on the list (2.6 and 3.0)

(2) The density (dp-density) here does not necessarily has physical meaning

This is due to the fact that under same pixel density, Google and HTC decided to define one unit of dp differently. That's why they have different values of dp even under same pixel density. This will create an effect that even if you specify the same value of dp, the View will have different physical size on these 2 devices.
Only if the whole world conform to the standard of 1x = 160dpi, dp can be used as a physical metrics.