Just like this:
/res/layout/layout.xml // Default layout /res/layout-small/layout.xml // Small screens /res/layout-large/layout.xml // Large screens /res/layout-xlarge/layout.xml // Ex
You can go even further and make different layouts for portrait and landscape views by specifying a different keyword in the directory name:
/res/layout-small-land/layout.xml // Small screens, landscape view /res/layout-small-portrait/layout.xml // Small screens, portrait view
Remember that the order of the tags is important, so you cannot write a mock-portrait-small.
And in the latter case, add this code to the manifest file:
<supports-screens android:resizeable="true" android:smallScreens="true" android:largeScreens="true" android:xlargeScreens="true" android:normalScreens="true" android:anyDensity="true"/>
source share