Search code examples
androidandroid-layouttablet

Layout for tablets in Android


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?


Solution

  • 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)