Unable to fit this layout to multiple screen resolution in android
<p>i have a Relative layout which has some buttons and imagebuttons with tabbar in bottom.</p>

<pre><code>&lt;?xml version="1.0" encoding="UTF-8"?&gt;
&lt;RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
    android:layout_width="fill_parent" android:layout_height="fill_parent"
    android:orientation="vertical" &gt;

   &lt;TextView android:id="@+id/statustext" android:layout_width="wrap_content" android:textColor = "@color/white" android:layout_height="wrap_content" 
        android:text="Welcome to www.****.com" android:layout_weight = "1" /&gt;

   &lt;EditText android:id="@+id/welcome" android:hint="Please enter your name" android:layout_width="fill_parent" android:scaleType="center" android:singleLine="true" 
          android:layout_below = @+id/statustext"  android:cursorVisible = "false" android:layout_height="wrap_content" android:layout_weight = "1" &gt;
   &lt;/EditText&gt;

&lt;RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android" android:layout_width="fill_parent" android:layout_height= "wrap_content"
                android:orientation="vertical" android:layout_below = "@+id/welcome"&gt;
&lt;Button android:layout_height="wrap_content" android:layout_weight = "1"   android:id="@+id/button1" android:text="new user" android:layout_below="@+id/welcome"        android:layout_width="103dp" android:layout_alignLeft="@+id/welcome"&gt;&lt;/Button&gt;
&lt;Button android:layout_height="wrap_content" android:layout_weight = "1"   android:id="@+id/button4" android:text="Registered?" android:layout_below="@+id/button1" android:layout_width="103dp" android:layout_alignLeft="@+id/button1" android:layout_alignRight="@+id/button1"&gt;&lt;/Button&gt;
&lt;Button android:layout_height="wrap_content" android:layout_weight = "1"   android:id="@+id/button7" android:text="Forgot Pass" android:layout_below="@+id/button4" android:layout_width="103dp" android:layout_alignLeft="@+id/button4" android:layout_alignRight="@+id/button4"&gt;&lt;/Button&gt;
&lt;Button android:layout_height="wrap_content" android:layout_weight = "1"   android:id="@+id/button10" android:text="Email" android:layout_below="@+id/button7" android:layout_width="103dp" android:layout_alignLeft="@+id/button7" android:layout_alignRight="@+id/button7"&gt;&lt;/Button&gt;
&lt;Button android:layout_height="wrap_content" android:layout_weight = "1"   android:id="@+id/button2" android:text="Sign-In" android:layout_width="103dp" android:layout_toRightOf="@+id/button1" android:layout_alignTop="@+id/button1" android:layout_alignBottom="@+id/button1"&gt;&lt;/Button&gt;
&lt;Button android:layout_height="wrap_content" android:layout_weight = "1"   android:id="@+id/button5" android:text="Username" android:layout_below="@+id/button2" android:layout_width="103dp" android:layout_alignLeft="@+id/button2" android:layout_alignRight="@+id/button2"&gt;&lt;/Button&gt;
&lt;Button android:layout_height="wrap_content" android:layout_weight = "1"   android:id="@+id/button8" android:text="Password" android:layout_below="@+id/button5" android:layout_width="103dp" android:layout_alignLeft="@+id/button5" android:layout_alignRight="@+id/button5"&gt;&lt;/Button&gt;
&lt;Button android:layout_height="wrap_content" android:layout_weight = "1"   android:id="@+id/button11" android:text="Cart" android:layout_below="@+id/button8" android:layout_width="103dp" android:layout_alignLeft="@+id/button8" android:layout_alignRight="@+id/button8"&gt;&lt;/Button&gt;
&lt;Button android:layout_height="wrap_content" android:layout_weight = "1"   android:id="@+id/button3" android:text="Search" android:layout_width="103dp" android:layout_toRightOf="@+id/button2" android:layout_alignTop="@+id/button2" android:layout_alignBottom="@+id/button2"&gt;&lt;/Button&gt;
&lt;Button android:layout_height="wrap_content" android:layout_weight = "1"   android:id="@+id/button6" android:text="Call *****" android:layout_below="@+id/button3" android:layout_width="103dp" android:layout_alignLeft="@+id/button3" android:layout_alignRight="@+id/button3"&gt;&lt;/Button&gt;
&lt;Button android:layout_height="wrap_content" android:layout_weight = "1"   android:id="@+id/button9" android:text="Register" android:layout_below="@+id/button6" android:layout_width="103dp" android:layout_alignLeft="@+id/button6" android:layout_alignRight="@+id/button6"&gt;&lt;/Button&gt;
&lt;Button android:layout_height="wrap_content" android:layout_weight = "1"   android:id="@+id/button12" android:text="Follow Us" android:layout_below="@+id/button9" android:layout_width="103dp" android:layout_alignLeft="@+id/button9" android:layout_alignRight="@+id/button9"&gt;&lt;/Button&gt;
&lt;Button android:id="@+id/bluebutton" android:layout_below = "@id/button10" android:layout_weight = "1" android:layout_height="wrap_content" android:layout_width="103dp" android:layout_alignParentLeft = "true"  android:background="@drawable/blue_logo"&gt;&lt;/Button&gt;
&lt;Button android:id="@+id/bluebutton" android:layout_below = "@id/button11" android:layout_weight = "1" android:layout_height="wrap_content" android:layout_width="103dp"   android:layout_toRightOf = "@+id/dialer" android:background="@drawable/orange_logo"&gt;&lt;/Button&gt;
&lt;Button android:id="@+id/blackbutton"  android:layout_below = "@id/button12" android:layout_weight = "1"  android:layout_height="wrap_content" android:layout_width="103dp" android:layout_toRightOf="@+id/orangebutton"  android:background="@drawable/black_logo" &gt;&lt;/Button&gt;
 &lt;/RelativeLayout&gt;

&lt;/RelativeLayout&gt;
</code></pre>

<p>My problem is that i looks fine in Google Nexus(H-533 ,W-320) calculated by </p>

<pre><code>   Display display = getWindowManager().getDefaultDisplay();
    int screenHeight = display.getHeight();
    int screenWidth = display.getWidth();
    Log.i("Screen Height = ",Integer.toString(screenHeight) );
    Log.i("Screen Width = ",Integer.toString(screenWidth) );
</code></pre>

<p>and i have created different folders according to resolution,its taking xml from </p>

<pre><code>layout-normal-mdpi
</code></pre>

<p>when i see this layout in HTC legend(H - 480 W-320) Or Samsung Ace the last three image buttons looking compressed about half of their height between normal button and Tabbar.The problem i guess in the small height with respect to Nexus, and all three devices are using same mdpi resolution xml file .So what should i do to make this layout work according to diff screen heights of same mdpi resolution devices.</p>

<p>If thats not possible from layout </p>

<blockquote>
  <p>weight</p>
</blockquote>

<p>can i change button size programmatically after calculating screen size?</p>

<p>Thanks</p>
