Smallest Width for Galaxy S and Galaxy S2

前端 未结 1 1610
滥情空心
滥情空心 2021-01-05 08:43

I\'m developing an Android Widget and need to differentiate between Galaxy S and Galaxy S2. I almost read everything about Screen sizes and

相关标签:
1条回答
  • 2021-01-05 09:27

    Screen density, as defined by the reference material is:

    The quantity of pixels within a physical area of the screen; usually referred to as dpi (dots per inch). For example, a "low" density screen has fewer pixels within a given physical area, compared to a "normal" or "high" density screen. For simplicity, Android groups all actual screen densities into four generalized densities: low, medium, high, and extra high.

    low = 120dpi med = 160dpi high = 240dpi xhi = 320dpi

    So the Galaxy SII, with a real density of 218, gets assigned a "high" density of 240 in dp calculations. Thus the width of the screen in dp is 480/240*160 = 320.

    This sucks, I agree. But it's how it works.

    http://developer.android.com/guide/practices/screens_support.html

    0 讨论(0)
提交回复
热议问题