I\'m developing an Android Widget and need to differentiate between Galaxy S and Galaxy S2. I almost read everything about Screen sizes and
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