title: Program that has proper layout on all device android
body: <p>I am currently writing a remote control program to control a robot on all android devices.
  I am trying to display the layout to fill the screen fully on different sizes. My first try was on a samsung 10.1' tablet and it was working well but when I port it to smaller devices like 4.3' the layout goes wrong. I am thinking of creating several layouts to match with different screen sizes but how do I check which layout to set according to screen sizes?
  I have tried getwidth and getheight but it only works after you have set the layout.
  Please give me a short sample code if possible as I am very new to this.</p>
  
  <p>If there are any other better ways please advice me on it.</p>
  
  <p>Please note that I am using API level 8, android 2.2. </p>