Hi there
According to http://developer.android.com/guide/topics/resources/providing-resources.html, sw480dp means «smallest side of screen must be at least 480 dp». Now dp is a «pixel on a 160 dpi screen», so actual size of e.g. Xperia in dp would be I guess 320 x 569 (provided it's a hdpi device). To get device screen size in dp you need to know abstracted density class (ldpi=120, mdpi=160, hdpi=240, xhdpi=320). For the above Xperia screen the calculation is: (480*160/240) x (854*160/240), where 160 is the base density (it's where 1 dp actually equal to one pixel) and 240 is device abstracted density. By using the above logic it should be sw320dp, But this logic also fails. Thank you. On Fri, Sep 28, 2012 at 5:09 PM, Marina Cuello <marina.ear...@gmail.com>wrote: > Your first two devices have a low density, lower than 160dpi, so they > measure on dp is smaller than what you expect. > Check http://developer.android.com/guide/practices/screens_support.htmlto get > the theory behind it. > Marina > On Sep 28, 2012 7:37 AM, "vinay kumar" <vk872...@gmail.com> wrote: > >> Hi, >> >> I am unable to get the values form "values-sw480dp" on my sony Xperia >> device which is 480 x 854 neither on Samsung galaxy tab which is 600 x >> 1024. But able to get on Motorola Xoom which is 1280 x 752. >> >> e.g res/values-sw480dp/strings.xml/ >> >> <string name="hello_world">hello world</string> >> >> The values on respective devices >> >> Sony Xperia * @2131034113* >> Samsung *@2131034113* >> on xoom * hello world* >> >> Can any one explain me this behavior, why Sony Xperia and Samsung has "* >> @2131034113*" value. >> >> >> Thank you in advance >> >> >> >> >> >> >> >> >> -- >> You received this message because you are subscribed to the Google >> Groups "Android Developers" group. >> To post to this group, send email to android-developers@googlegroups.com >> To unsubscribe from this group, send email to >> android-developers+unsubscr...@googlegroups.com >> For more options, visit this group at >> http://groups.google.com/group/android-developers?hl=en > > -- > You received this message because you are subscribed to the Google > Groups "Android Developers" group. > To post to this group, send email to android-developers@googlegroups.com > To unsubscribe from this group, send email to > android-developers+unsubscr...@googlegroups.com > For more options, visit this group at > http://groups.google.com/group/android-developers?hl=en -- You received this message because you are subscribed to the Google Groups "Android Developers" group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en