I am developing an app in which I have to make our app to fit for every device - for both tablet and android mobiles. Now I want to get the device height and width at runtim
this is how you get the available screen dimensions. This will get you not the raw pixel size but the available space of your window/activity.
Point outSize = new Point();
getWindowManager().getDefaultDisplay().getSize(outSize);
Also you can have different layout xml files for both landscape and portrait. Put your xml for portrait in res/layout-port. Layout for landscape can be put into res/layout-land. You should read up how android handles resources