[android-developers] Android resource qualifier

2012-09-28 Thread vinay kumar
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_worldhello world/string The values

Re: [android-developers] Android resource qualifier

2012-09-28 Thread Marina Cuello
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.html to get the theory behind it. Marina On Sep 28, 2012 7:37 AM, vinay kumar vk872...@gmail.com wrote: Hi, I

Re: [android-developers] Android resource qualifier

2012-09-28 Thread vinay kumar
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

Re: [android-developers] Android resource qualifier

2012-09-28 Thread Marina Cuello
I'm sorry. I wrote lower when I was thinking higher, LOL. The dpi values for ldpi, mdpi and so on are only standard ones, and most devices have different values. Try getting the xDpi and yDpi from a DisplayMetrics. I have an Xperia Neo V and the width was around 250dp. Marina On Sep 28, 2012 8:51

Re: [android-developers] Android resource qualifier

2012-09-28 Thread vinay kumar
I checked for xdpi and ydpi values on my device call following method in oncreate method. DisplayMetrics metrics = new DisplayMetrics(); getWindowManager().getDefaultDisplay().getMetrics(metrics); metrics.xdpi; 239.05882 metrics.ydpi; 243.72585