title: How to fix screen size compatible to all android device in android?
body: <p>I have an <code>application with some buttons</code>. The button <code>styles are xml gradients</code>. When running this app in <code>3.2 QVGA emulator</code> the widgets goes outside to the view like this </p>
  
  <p><strong>Emulator screen shot:</strong></p>
  
  <p><img src="https://i.stack.imgur.com/XBnSP.png" alt="emulator screen shot"></p>
  
  <p>While running on a 5 inch display device I have getting complete view. </p>
  
  <p><strong>Device screen shot:</strong></p>
  
  <p><img src="https://i.stack.imgur.com/y77Hu.png" alt="device screen shot"></p>
  
  <p>How can I fix this issue by support all screen size compatibility? </p>
  
  <pre><code>&lt;RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
      xmlns:tools="http://schemas.android.com/tools"
      android:layout_width="match_parent"
      android:layout_height="match_parent"
      android:background="@drawable/background"
      tools:context="${relativePackage}.${activityClass}" &gt;
  
      &lt;LinearLayout
          android:id="@+id/linearLayout4"
          android:layout_width="fill_parent"
          android:layout_height="wrap_content"
          android:orientation="vertical" &gt;
  
          &lt;RelativeLayout
              android:id="@+id/linearLayout1"
              android:layout_width="fill_parent"
              android:layout_height="110dp"
              android:layout_alignParentTop="true"
              android:layout_marginTop="50dp"
              android:orientation="horizontal" &gt;
  
              &lt;Button
                  android:id="@+id/imageExpense"
                  android:layout_width="90dp"
                  android:layout_height="95dp"
                  android:layout_marginLeft="35dp"
                  android:layout_marginTop="5dp"
                  android:background="@drawable/add_btnstyle"
                  android:gravity="center|bottom"
                  android:padding="10dp"
                  android:text="Expense" /&gt;
  
              &lt;Button
                  android:id="@+id/imageIncome"
                  android:layout_width="90dp"
                  android:layout_height="95dp"
                  android:layout_alignParentRight="true"
                  android:layout_marginRight="40dp"
                  android:layout_marginTop="5dp"
                  android:background="@drawable/add_btnstyle"
                  android:gravity="center|bottom"
                  android:padding="10dp"
                  android:text="Income"
                  android:textAlignment="gravity" /&gt;
  
              &lt;ImageView
                  android:id="@+id/imageView1"
                  android:layout_width="60dp"
                  android:layout_height="65dp"
                  android:layout_alignLeft="@+id/imageExpense"
                  android:layout_alignParentTop="true"
                  android:layout_marginLeft="13dp"
                  android:layout_marginTop="12dp"
                  android:src="@drawable/expense" /&gt;
  
              &lt;ImageView
                  android:id="@+id/imageView2"
                  android:layout_width="50dp"
                  android:layout_height="50dp"
                  android:layout_alignRight="@+id/imageIncome"
                  android:layout_alignTop="@+id/imageView1"
                  android:layout_marginRight="20dp"
                  android:layout_marginTop="7dp"
                  android:src="@drawable/income" /&gt;
          &lt;/RelativeLayout&gt;
  
          &lt;RelativeLayout
              android:id="@+id/linearLayout2"
              android:layout_width="fill_parent"
              android:layout_height="110dp"
              android:layout_alignParentLeft="true"
              android:layout_below="@+id/linearLayout1"
              android:layout_marginTop="60dp"
              android:orientation="horizontal" &gt;
  
              &lt;Button
                  android:id="@+id/imageReport"
                  android:layout_width="90dp"
                  android:layout_height="95dp"
                  android:layout_marginLeft="35dp"
                  android:layout_marginRight="40dp"
                  android:layout_marginTop="5dp"
                  android:background="@drawable/add_btnstyle"
                  android:gravity="center|bottom"
                  android:padding="10dp"
                  android:text="Report" /&gt;
  
              &lt;ImageView
                  android:id="@+id/imageViewRep"
                  android:layout_width="45dp"
                  android:layout_height="45dp"
                  android:layout_marginLeft="57dp"
                  android:layout_marginTop="20dp"
                  android:src="@drawable/pie_chart" /&gt;
  
              &lt;Button
                  android:id="@+id/imageSettings"
                  android:layout_width="90dp"
                  android:layout_height="95dp"
                  android:layout_alignParentRight="true"
                  android:layout_marginRight="40dp"
                  android:layout_marginTop="5dp"
                  android:background="@drawable/add_btnstyle"
                  android:gravity="center|bottom"
                  android:padding="10dp"
                  android:text="Settings" /&gt;
  
              &lt;ImageView
                  android:id="@+id/imageView4"
                  android:layout_width="45dp"
                  android:layout_height="45dp"
                  android:layout_alignRight="@+id/imageSettings"
                  android:layout_alignTop="@+id/imageView3"
                  android:layout_marginRight="22dp"
                  android:layout_marginTop="20dp"
                  android:src="@drawable/system_config_services" /&gt;
          &lt;/RelativeLayout&gt;
      &lt;/LinearLayout&gt;
  
      &lt;LinearLayout
          android:id="@+id/linearLayout3"
          android:layout_width="fill_parent"
          android:layout_height="wrap_content"
          android:layout_below="@+id/linearLayout4"
          android:layout_centerHorizontal="true"
          android:layout_margin="20dp"
  
          android:orientation="vertical"
          android:padding="20dp" &gt;
  
          &lt;Button
              android:id="@+id/imageAbout"
              android:layout_width="200dp"
              android:layout_height="55dp"
              android:layout_gravity="center_horizontal"
              android:background="@drawable/settings_add_btnstyle"
              android:text="Log Off" /&gt;
  
          &lt;TextView
              android:id="@+id/txtLogo"
              android:layout_width="wrap_content"
              android:layout_height="wrap_content"
              android:layout_gravity="center_horizontal"
              android:layout_marginTop="20dp"
              android:text="Powered by Microclouds India Pvt Ltd"
              android:textAppearance="?android:attr/textAppearanceSmall"
              android:textSize="12sp"
              android:textStyle="italic" /&gt;
      &lt;/LinearLayout&gt;
  
  &lt;/RelativeLayout&gt;
  </code></pre>