title: How to build app to fit all screen size in android xml
body: <p>I'm creating my first app and it's very simple, and while creating it i tested the app on my phone (gs3  4.8 inches). However, when i tested it with different phones the whole thing was distorted. I was wondering how i could fix it or if I built the whole thing wrong. I don't have enough reputation points to post an image but I'll describe what happens. I have a background image with buttons on top of it and the buttons have to be in a very specific spot and if the arn't the whole thing look s messed up. My code is</p>
  
  <pre><code>&lt;?xml version="1.0" encoding="utf-8"?&gt;
  &lt;FrameLayout xmlns:android="http://schemas.android.com/apk/res/android"
  android:layout_width="wrap_content"
  android:layout_height="wrap_content" &gt;
  
  &lt;ImageView
      android:id="@+id/ivReturnedPic"
  android:layout_width="wrap_content"
  android:layout_height="wrap_content"
      android:layout_gravity="center"
      android:src="@drawable/newbeach3" /&gt;
  
  &lt;TextView
  android:id="@+id/textView1"
  
  android:layout_width="wrap_content"
  android:layout_height="wrap_content"
      android:layout_alignParentRight="true"
  android:layout_alignParentTop="true"
  android:layout_marginRight="300dp"
  android:layout_marginTop="570dp"
  android:text="Intensity:" /&gt;
  
   SeekBar
  android:id="@+id/seekBar1"
  android:layout_width="355dp"
  android:layout_height="wrap_content"
      android:layout_marginTop="590dp"
  android:layout_alignParentLeft="true"
  android:layout_alignParentTop="true" /&gt;
  
  &lt;RelativeLayout
  android:layout_width="match_parent"
  android:layout_height="match_parent"
  android:layout_gravity="top" &gt;
  
  &lt;Button
      android:id="@+id/bvibrate2"
      android:layout_width="160dp"
      android:layout_height="35dp"
      android:layout_alignParentRight="true"
      android:layout_alignParentTop="true"
      android:layout_marginRight="14dp"
      android:layout_marginTop="175dp"
      android:background="@drawable/piece2"
      android:text="Pattern 2" /&gt;
  
  &lt;Button
      android:id="@+id/bvibrate1"
      android:layout_width="160dp"
      android:layout_height="35dp"
      android:layout_alignParentRight="true"
      android:layout_alignParentTop="true"
      android:layout_marginRight="187dp"
      android:layout_marginTop="175dp"
      android:background="@drawable/piece1"
      android:text="Pattern 1" /&gt;
  
  &lt;Button
      android:id="@+id/bvibrate3"
      android:layout_width="160dp"
      android:layout_height="35dp"
      android:layout_alignParentRight="true"
      android:layout_alignParentTop="true"
      android:layout_marginRight="187dp"
      android:layout_marginTop="291dp"
      android:background="@drawable/piece3"
      android:text="Pattern 3" /&gt;
  
  &lt;Button
      android:id="@+id/bvibrate4"
      android:layout_width="160dp"
      android:layout_height="35dp"
      android:layout_alignParentRight="true"
      android:layout_alignParentTop="true"
      android:layout_marginRight="14dp"
      android:layout_marginTop="291dp"
      android:background="@drawable/piece4"
      android:text="Pattern 4" /&gt;
  
  &lt;Button
      android:id="@+id/bvibrate6"
      android:layout_width="160dp"
      android:layout_height="35dp"
      android:layout_alignParentRight="true"
      android:layout_alignParentTop="true"
      android:layout_marginRight="14dp"
      android:layout_marginTop="407dp"
      android:background="@drawable/piece6"
      android:text="Pattern 6" /&gt;
  
  &lt;Button
      android:id="@+id/bvibrate5"
      android:layout_width="160dp"
      android:layout_height="35dp"
      android:layout_alignParentRight="true"
      android:layout_alignParentTop="true"
      android:layout_marginRight="187dp"
      android:layout_marginTop="407dp"
      android:background="@drawable/piece5"
      android:text="Pattern 5" /&gt;
  
  &lt;Button
      android:id="@+id/bvibrate7"
      android:layout_width="160dp"
      android:layout_height="35dp"
      android:layout_alignParentRight="true"
      android:layout_alignParentTop="true"
      android:layout_marginRight="187dp"
      android:layout_marginTop="523dp"
      android:background="@drawable/piece7"
      android:text="Pattern 7" /&gt;
  
  &lt;Button
      android:id="@+id/bvibrate8"
      android:layout_width="160dp"
      android:layout_height="35dp"
      android:layout_alignParentRight="true"
      android:layout_alignParentTop="true"
      android:layout_marginRight="14dp"
      android:layout_marginTop="523dp"
      android:background="@drawable/piece8"
      android:text="Pattern 8" /&gt;
  
  &lt;Button
      android:id="@+id/bstop"
      android:layout_width="87dp"
      android:layout_height="87dp"
      android:layout_alignParentTop="true"
      android:layout_alignRight="@+id/bvibrate1"
      android:layout_marginRight="29dp"
      android:layout_marginTop="52dp"
      android:background="@drawable/square"
      android:text="Stop" /&gt;
  &lt;/RelativeLayout&gt;
  </code></pre>
  
  <p></p>