<!-- relativelayout example -->
<RelativeLayout
    xmlns:android="http://schemas.android.com/apk/res/android"
    android:layout_width="match_parent"
    android:layout_height="match_parent">

    <Button
        android:id="@+id/firstbutton"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:layout_alignParentLeft="true"
        android:layout_alignParentTop="true"/>

    <Button
        android:id="@+id/secondbutton"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:layout_toRightOf="@id/firstbutton"
        android:layout_below="@id/firstbutton"/>

    <Button
        android:id="@+id/thirdbutton"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:layout_toRightOf="@id/secondbutton"
        android:layout_below="@id/secondbutton"/>

    <Button
        android:id="@+id/fourthbutton"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:layout_toRightOf="@id/thirdbutton"
        android:layout_below="@id/thirdbutton"/>

    <Button
        android:id="@+id/fifthbutton"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:layout_toLeftOf="@id/fourthbutton"
        android:layout_below="@id/fourthbutton"/>
</RelativeLayout>