You can achieved this by Using configuration qualifiers. Put the different .xml layout files in the following res
folders specifically and android will do it for you.
res/layout-small/login.xml // login layout for small portrait
res/layout-normal/login.xml // login layout for normal portrait
res/layout-normal-land/login.xml // login layout for normal land
res/layout-large/login.xml // login layout for large portrait
res/layout-large-land/login.xml // login layout for large land
You can just use the login.xml and android will choose the proper one for you.
Note. for android 3.2 or higher, a new configuration qualifiers system is used. You can read more about it from the official develop guide.
EDIT:
BTW, each screen size is defined as:
- xlarge screens are at least 960dp x 720dp
- large screens are at least 640dp x 480dp
- normal screens are at least 470dp x 320dp
- small screens are at least 426dp x 320dp
They can be overlapped sometime, read this for more info.