I would like to create different layouts for tablets and handsets in Android. Where should I put the layout resources in order to make this differentiation?
To ensure that your layout is flexible and adapts to different screen sizes, you should use "wrap_content" and "match_parent" for the width and height of some view components.
Use Relative layouts, draw 9 images. And for high quality apps you may create different different layout XMLS for all 4 screen sizes. http://developer.android.com/guide/practices/screens_support.html Use this link for more info. Show activity on this post.
I know this is an old question, but for the sake of it... According documentation, you should create mutiple asset folders like this
res/layout/main_activity.xml # For handsets (smaller than 600dp available width) res/layout-sw600dp/main_activity.xml # For 7” tablets (600dp wide and bigger) res/layout-sw720dp/main_activity.xml # For 10” tablets (720dp wide and bigger)
If you are using Fragment concept in the code(means Multi-Pane layout) then its best to use wdp instead of swdp
res/layout-w600dp/main_activity.xml # For 7” tablets (600dp wide and bigger) res/layout-w720dp/main_activity.xml # For 10” tablets (720dp wide and bigger) res/layout-w600dp-land/main_activity.xml # For 7” tablets in landscape (600dp wide and bigger) res/layout-w720dp-land/main_activity.xml # For 10” tablets in landscape (720dp wide and bigger)
Refer the table for understanding wdp
Table 2. New configuration qualifers for screen size (introduced in Android 3.2).
In the following link http://developer.android.com/guide/practices/screens_support.html
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With