Android: auto-resize for each device
<p>I've create a very simple app and i download it in 15 different devices. For some of them the layout have no resize problem and appear like this:</p>

<p><a href="http://i.stack.imgur.com/ZjJK8.jpg" rel="nofollow">Layout that should be in all layouts</a></p>

<p>But when i installed the app in a Sansung Galaxy Neo Plus and in the tablet Archos 101 Copper the items' layout were not in the position that i want. In the tablet are up of the background different color view and in the Galaxy Neo Plus are like this:
<a href="http://i.stack.imgur.com/jF7AC.jpg" rel="nofollow">Layout in the Galaxy Neo Plus</a></p>

<p>To auto-resize, in the activities xml, i used thse codes:</p>

<pre><code>android:layout_marginTop="125dp"
android:layout_marginBottom="15dp"
android:layout_marginRight="20dp"
android:layout_marginLeft="20dp"
</code></pre>

<p>to set the buttons' margin from top/bottom/left/right</p>

<pre><code>android:textSize="30dp"
</code></pre>

<p>to set the size of buttons' text</p>

<p>The layout code is this:</p>

<pre><code>&lt;RelativeLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="@drawable/bg"

&lt;TextView
    android:layout_width="wrap_content"
    android:layout_height="wrap_content"
    android:text="Al meglio di:"
    android:textSize="22dp"
    android:id="@+id/almegliodi"
    android:layout_alignParentTop="true"
    android:layout_marginTop="220dp"
    android:layout_centerHorizontal="true"
    android:typeface="serif"
    android:textStyle="bold|italic"
    android:textAppearance="?android:attr/textAppearanceLarge"
    android:gravity="center" /&gt;

&lt;Button
    android:layout_width="wrap_content"
    android:layout_height="wrap_content"
    android:text=" UNO "
    android:textStyle="bold"
    android:textSize="35dp"
    android:textColor="@android:color/white"
    android:id="@+id/uno"
    android:background="@android:drawable/dialog_holo_dark_frame"
    android:onClick="uno"
    android:layout_below="@+id/almegliodi"
    android:layout_marginTop="30dp"
    android:layout_centerHorizontal="true"/&gt;
&lt;Button
    android:layout_width="wrap_content"
    android:layout_height="wrap_content"
    android:text=" TRE "
    android:textStyle="bold"
    android:textSize="35dp"
    android:textColor="@android:color/white"
    android:id="@+id/tre"
    android:background="@android:drawable/dialog_holo_dark_frame"
    android:onClick="tre"
    android:layout_centerHorizontal="true"
    android:layout_below="@+id/uno"
    android:layout_marginTop="30dp"/&gt;
&lt;Button
    android:layout_width="wrap_content"
    android:layout_height="wrap_content"
    android:text=" CINQUE "
    android:textStyle="bold"
    android:textSize="35dp"
    android:textColor="@android:color/white"
    android:id="@+id/cinque"
    android:background="@android:drawable/dialog_holo_dark_frame"
    android:onClick="cinque"
    android:layout_centerHorizontal="true"
    android:layout_below="@+id/tre"
    android:layout_marginTop="30dp"/&gt;
&lt;Button
    android:layout_width="wrap_content"
    android:layout_height="wrap_content"
    android:text="ESCI"
    android:textStyle="bold"
    android:textSize="30dp"
    android:id="@+id/esci"
    android:background="@android:color/transparent"
    android:layout_marginBottom="7dp"
    android:layout_marginLeft="30dp"
    android:layout_alignParentLeft="true"
    android:layout_alignParentBottom="true"
    android:onClick="esci"
    /&gt;
&lt;Button
    android:layout_width="wrap_content"
    android:layout_height="wrap_content"
    android:text="INDIETRO"
    android:textStyle="bold"
    android:textSize="30dp"
    android:textColor="@android:color/white"
    android:id="@+id/indietro"
    android:background="@android:color/transparent"
    android:onClick="indietro"
    android:layout_alignParentRight="true"
    android:layout_alignParentBottom="true"
    android:layout_alignTop="@+id/esci"
    android:layout_marginRight="30dp"
    android:layout_marginBottom="7dp"
    /&gt;
&lt;/RelativeLayout
</code></pre>

<p>I searched on google but i found that use the 'dp' is the best way to auto-resize margin and text in all device.</p>

<p>What are my mistakes? What i have to do to solve the compatibility?</p>

<p>Thank you</p>