2

I learned that we should use "dp" to give our applications the ability of supporting multiple screens. But I find in reality, this works far from well.

Let me show you an example: Assume we have two screens. Screen A has a resolution of 160 * 160 px and 1 inch length and width. Screen B has a resolution of 1600 * 1600 px and 10 inches length and width. According to the definition of Density Buckets, both of the two screens fall into mdpi(medium)~160dpi. So both of the phones using these screens will use the same layouts and drawables. However, we know that 1 dp could be converted to 1px in the case of 160dpi. So this means screen A is 160dp in width and screen B is 1600dp in width. And if we try to show an image which is set to 300 dp in width in the screen, the result is for sure very different. So I am wondering how come android rely on dp to support multiple screens or If I have some misunderstandings about this concept?

jeep
  • 615
  • 2
  • 10
  • 19

0 Answers0