-2

When I create small,normal,large,xlarge layouts:How Android Detects Screen Size phone for use this layouts?base on dp or dpi or px? Is the result always right?Because some devices are smaller in physical size but the density is higher so if based on density this detect is not always correct. Am I right?

Phantômaxx
  • 37,901
  • 21
  • 84
  • 115
M.ghorbani
  • 129
  • 8

1 Answers1

0

Android uses dp, but there are a lot of variants you can create in your resources for example

res/layout/main_activity.xml           # For handsets (smaller than 600dp available width)
res/layout-sw600dp/main_activity.xml   # For 7” tablets (600dp wide and bigger)

You can cover more resolutions using different configs, but I think is hard work to cover everything, because how I said we have different resolutions, screen sizes and now we have notch.

res/layout-560dpi/
res/layout-ldpi/ ...

Bellow, I copy a link about this

https://developer.android.com/training/multiscreen/screensizes

Anderson Soares
  • 317
  • 1
  • 3