title: Understanding Android layout and size
body: <p>Can someone please help me with Android layouts. I have been researching it for a week now and I'm as confused as ever.
  Here is my problem. </p>
  
  <p>Say I have a layout as per this image (roughly to scale). </p>
  
  <p><img src="https://i.stack.imgur.com/lj4TS.png" alt="arbitrary phone with approximate layout"></p>
  
  <p>Its a simple view with a background image (which I stretch to fit).
  On this view I have a:</p>
  
  <ul>
  <li>Top: A "Welcome" image that fills 80% of the width of the view and is 10% from left of view and 10% from right of view</li>
  <li>Middle: 6 X Navigation buttons, again filling 80% of the width of the view and is 10% from left of view and 10% from right of view</li>
  <li>Bottom: An footer image that fills 100% of the width of the screen</li>
  </ul>
  
  <p>I am trying to create the images (.png files) to use for the top image, the nav buttons and footer image, and this is where the problem starts. 
  I use pixel values to define the sizes of the buttons, but of course Android does not work like this.
  I have found online a rough size guide (in pixels) of the most popular screen resolutions - ldpi, mdpi, hdpi and xhdpi as indicated below. resolutions. Sorry I forget where the source was.</p>
  
  <p>"Usually, I design mdpi images for a 320x480 screen and then multiply the dimensions as per the rules to get images for other 
  Basically, General guidelines for designing images are:</p>
  
  <p>mdpi - 320 x 480</p>
  
  <ul>
  <li>ldpi is 0.75x dimensions of mdpi (240 x 360)</li>
  <li>hdpi is 1.5x dimensions of mdpi (480 x 720)</li>
  <li>xhdpi is 2x dimensinons of mdpi (640 x 960)" </li>
  </ul>
  
  <p>I have created a navigation button to test and set sizes in pixel values as follows (NOTE: this is only width as height was scaled accordingly to maintain perspective)</p>
  
  <ul>
  <li>ldpi - 160 pixels</li>
  <li>mdpi - 280 pixels</li>
  <li>hdpi - 420 pixels</li>
  <li>xhdpi - 680 pixels</li>
  </ul>
  
  <p>This all seems to be OK when viewing on differnt emulators within Eclipse. But tonight I came across this on the Android developers page. 
  <a href="http://developer.android.com/guide/practices/screens_support.html#testing" rel="nofollow noreferrer">http://developer.android.com/guide/practices/screens_support.html#testing</a></p>
  
  <p>At the bottom of the page it breaks small, medium, large and extra large screens up further into each being able to have ldpi, mdpi, hdpi and xhdpi.</p>
  
  <p>Now I'm totally lost. Should I therefore create 16 different images for each button, each with a slightly different size and then let Android decide which one fits best?
  And I also read that its good practice to define different layouts as well depending on screen resolutions. 
  This I can kind of understand as you can have different layouts on bigger sizes, but dont think I will need it in my situation. 
  Its only a very basic app and I wont require different layouts and functionality for different screen sizes.
  The app will have to support all/most phone screen sizes but not necessarily tablets</p>
  
  <p>Maybe I have this all the wrong way round but this is very confusing for me.</p>
  
  <p>Can anyone please break it down to its simplest form for me please?</p>