In my application, I support the phone / tablet form factor, and for individual layouts I use the selector “layout” (for phones), “layout-sw600dp” (for tablets).
The following is the data:
http://android-developers.blogspot.in/2011/07/new-tools-for-managing-screen-sizes.html
Typical numbers for screen width dp are: 320: a phone screen (240x320 ldpi, 320x480 mdpi, 480x800 hdpi, etc). 480: a tweener tablet like the Streak (480x800 mdpi). 600: a 7" tablet (600x1024). 720: a 10" tablet (720x1280, 800x1280, etc).
I have a Nexus 4 mobile phone following its attirbutes
Size: 4.7 inches Resolution: 768 x 1280 pixels DPI: 318 dp: 386 Here is the dp calculation dp = (px * 160)/dpi dp = (768 * 160)/318
When I use 768 px in the dp calculation formula, the dp value appears as 386, but when I pass 1280 px, the dp value appears as 644.
With the following understanding, I thought that for the Nexus 4 landscape it would read the layout from sw600dp, but that is not the case.
Since the resolution is width X Height, turning the device will cancel it.
I thought this improvisation done with sw selectors compares to pre-3.2 large, large sectors.
Mukesh bhojwani
source share