title: How to display Admob on the top of my Layout using XML on Android?
body: <p>I'm kind of struggling with the new AdMob. <strong>I want my ad to display on the top</strong> as on the image below:</p>
  
  <p><img src="https://storage.googleapis.com/support-kms-prod/SNP_2778510_en_v2" alt="a"></p>
  
  <p>I'm doing what the google documentation says but <strong>the ad always appears on the bottom</strong> (after all my other views)...</p>
  
  <p><em><strong>Notes:</em></strong> </p>
  
  <ul>
  <li><p><em>It displays it properly (at the top of the screen) on the Eclipse's XML preview but not on my emulator/physical devices.</em></p></li>
  <li><p><em>It concerns all my XML files I have done since I use AdMob, not especially this one.</em></p></li>
  </ul>
  
  <p>I tried many different techniques and did a lot of researches but all the questions and answers I find (on SO and other websites) concern the "old" AdMob display (pre winter 2013).</p>
  
  <p>Here is on of my XML file, <strong>the interesting part is certainly on the top, after the com.google.android.gms.ads.AdView it's only a "grid" made in LinearLayout followed by one bigger button</strong>:</p>
  
  <pre><code>&lt;?xml version="1.0" encoding="utf-8"?&gt;
  &lt;LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
      xmlns:tools="http://schemas.android.com/tools"
      xmlns:ads="http://schemas.android.com/apk/res-auto"
      android:id="@+id/mainLayout"
      android:layout_width="match_parent"
      android:layout_height="match_parent"
      android:background="@drawable/gradient"
      android:orientation="vertical"
      tools:context=".MainActivity" &gt;
  
   &lt;com.google.android.gms.ads.AdView
          android:id="@+id/adView"
          android:layout_width="wrap_content"
          android:layout_height="wrap_content"
          ads:adSize="BANNER"
          ads:adUnitId="MY HIDDEN AD UNIT ID" /&gt;
  
  
   &lt;!-- The part below is a grid made of 4 Linear Layouts displaying buttons --&gt;
  
  &lt;LinearLayout
      android:layout_width="match_parent"
      android:layout_height="wrap_content"
      android:gravity="center"
      android:orientation="horizontal" &gt;
  
      &lt;Button
          android:id="@+id/Button1"
          android:layout_width="60dp"
          android:layout_height="60dp"
          android:layout_margin="10dp"
          android:alpha="0.5"
          android:background="#424242"
          android:clickable="false"
          android:scaleType="fitCenter"
          android:text="1"
          android:textColor="#fff"
          android:textSize="24sp"
          android:textStyle="bold" /&gt;
  
      &lt;Button
          android:id="@+id/Button2"
          android:layout_width="60dp"
          android:layout_height="60dp"
          android:layout_margin="10dp"
          android:alpha="0.5"
          android:background="#424242"
          android:clickable="false"
          android:enabled="false"
          android:scaleType="fitCenter"
          android:text="2"
          android:textColor="#fff"
          android:textSize="24sp"
          android:textStyle="bold" /&gt;
  
      &lt;Button
          android:id="@+id/Button3"
          android:layout_width="60dp"
          android:layout_height="60dp"
          android:layout_margin="10dp"
          android:alpha="0.5"
          android:background="#424242"
          android:clickable="false"
          android:enabled="false"
          android:scaleType="fitCenter"
          android:text="3"
          android:textColor="#fff"
          android:textSize="24sp"
          android:textStyle="bold" /&gt;
  
      &lt;Button
          android:id="@+id/Button4"
          android:layout_width="60dp"
          android:layout_height="60dp"
          android:layout_margin="10dp"
          android:alpha="0.5"
          android:background="#424242"
          android:clickable="false"
          android:enabled="false"
          android:scaleType="fitCenter"
          android:text="4"
          android:textColor="#fff"
          android:textSize="24sp"
          android:textStyle="bold" /&gt;
  &lt;/LinearLayout&gt;
  
  &lt;LinearLayout
      android:layout_width="match_parent"
      android:layout_height="wrap_content"
      android:gravity="center"
      android:orientation="horizontal" &gt;
  
      &lt;Button
          android:id="@+id/Button5"
          android:layout_width="60dp"
          android:layout_height="60dp"
          android:layout_margin="10dp"
          android:alpha="0.5"
          android:background="#424242"
          android:clickable="false"
          android:enabled="false"
          android:scaleType="fitCenter"
          android:text="5"
          android:textColor="#fff"
          android:textSize="24sp"
          android:textStyle="bold" /&gt;
  
      &lt;Button
          android:id="@+id/Button6"
          android:layout_width="60dp"
          android:layout_height="60dp"
          android:layout_margin="10dp"
          android:alpha="0.5"
          android:background="#424242"
          android:clickable="false"
          android:enabled="false"
          android:scaleType="fitCenter"
          android:text="6"
          android:textColor="#fff"
          android:textSize="24sp"
          android:textStyle="bold" /&gt;
  
      &lt;Button
          android:id="@+id/Button7"
          android:layout_width="60dp"
          android:layout_height="60dp"
          android:layout_margin="10dp"
          android:alpha="0.5"
          android:background="#424242"
          android:clickable="false"
          android:enabled="false"
          android:scaleType="fitCenter"
          android:text="7"
          android:textColor="#fff"
          android:textSize="24sp"
          android:textStyle="bold" /&gt;
  
      &lt;Button
          android:id="@+id/Button8"
          android:layout_width="60dp"
          android:layout_height="60dp"
          android:layout_margin="10dp"
          android:alpha="0.5"
          android:background="#424242"
          android:clickable="false"
          android:enabled="false"
          android:scaleType="fitCenter"
          android:text="8"
          android:textColor="#fff"
          android:textSize="24sp"
          android:textStyle="bold" /&gt;
  &lt;/LinearLayout&gt;
  
  &lt;LinearLayout
      android:layout_width="match_parent"
      android:layout_height="wrap_content"
      android:gravity="center"
      android:orientation="horizontal" &gt;
  
      &lt;Button
          android:id="@+id/Button9"
          android:layout_width="60dp"
          android:layout_height="60dp"
          android:layout_margin="10dp"
          android:alpha="0.5"
          android:background="#424242"
          android:clickable="false"
          android:enabled="false"
          android:scaleType="fitCenter"
          android:text="9"
          android:textColor="#fff"
          android:textSize="24sp"
          android:textStyle="bold" /&gt;
  
      &lt;Button
          android:id="@+id/Button10"
          android:layout_width="60dp"
          android:layout_height="60dp"
          android:layout_margin="10dp"
          android:alpha="0.5"
          android:background="#424242"
          android:clickable="false"
          android:enabled="false"
          android:scaleType="fitCenter"
          android:text="10"
          android:textColor="#fff"
          android:textSize="24sp"
          android:textStyle="bold" /&gt;
  
      &lt;Button
          android:id="@+id/Button11"
          android:layout_width="60dp"
          android:layout_height="60dp"
          android:layout_margin="10dp"
          android:alpha="0.5"
          android:background="#424242"
          android:clickable="false"
          android:enabled="false"
          android:scaleType="fitCenter"
          android:text="11"
          android:textColor="#fff"
          android:textSize="24sp"
          android:textStyle="bold" /&gt;
  
      &lt;Button
          android:id="@+id/Button12"
          android:layout_width="60dp"
          android:layout_height="60dp"
          android:layout_margin="10dp"
          android:alpha="0.5"
          android:background="#424242"
          android:clickable="false"
          android:enabled="false"
          android:scaleType="fitCenter"
          android:text="12"
          android:textColor="#fff"
          android:textSize="24sp"
          android:textStyle="bold" /&gt;
  &lt;/LinearLayout&gt;
  
  &lt;LinearLayout
      android:layout_width="match_parent"
      android:layout_height="wrap_content"
      android:gravity="center"
      android:orientation="horizontal" &gt;
  
      &lt;Button
          android:id="@+id/Button13"
          android:layout_width="60dp"
          android:layout_height="60dp"
          android:layout_margin="10dp"
          android:alpha="0.5"
          android:background="#424242"
          android:clickable="false"
          android:enabled="false"
          android:scaleType="fitCenter"
          android:text="13"
          android:textColor="#fff"
          android:textSize="24sp"
          android:textStyle="bold" /&gt;
  
      &lt;Button
          android:id="@+id/Button14"
          android:layout_width="60dp"
          android:layout_height="60dp"
          android:layout_margin="10dp"
          android:alpha="0.5"
          android:background="#424242"
          android:clickable="false"
          android:enabled="false"
          android:scaleType="fitCenter"
          android:text="14"
          android:textColor="#fff"
          android:textSize="24sp"
          android:textStyle="bold" /&gt;
  
      &lt;Button
          android:id="@+id/Button15"
          android:layout_width="60dp"
          android:layout_height="60dp"
          android:layout_margin="10dp"
          android:alpha="0.5"
          android:background="#424242"
          android:clickable="false"
          android:enabled="false"
          android:scaleType="fitCenter"
          android:text="15"
          android:textColor="#fff"
          android:textSize="24sp"
          android:textStyle="bold" /&gt;
  
      &lt;Button
          android:id="@+id/Button16"
          android:layout_width="60dp"
          android:layout_height="60dp"
          android:layout_margin="10dp"
          android:alpha="0.5"
          android:background="#424242"
          android:clickable="false"
          android:enabled="false"
          android:scaleType="fitCenter"
          android:text="16"
          android:textColor="#fff"
          android:textSize="24sp"
          android:textStyle="bold" /&gt;
  &lt;/LinearLayout&gt;
  
  
  
  
      &lt;Button
          android:id="@+id/ButtonErase"
          android:layout_width="match_parent"
          android:layout_height="wrap_content"
          android:layout_margin="10dp"
          android:alpha="0.5"
          android:background="#ff0000"
          android:scaleType="fitCenter"
          android:text="@string/erase"
          android:textColor="#fff"
          android:textSize="18sp"
          android:textStyle="bold" /&gt;
  
  &lt;/LinearLayout&gt;
  </code></pre>
  
  <p>I could change my LinearLayout to a Relative one, if you think it's a solution, but I find the LinearLayout easier to play with.</p>
  
  <p>My question is, of course: <strong>What should I change to display my Ad at the top of the screen instead of at the bottom of the screen ?</strong> What didn't I get here ? <em>All documentation you have is welcomed, I just can't find enough resources/SO posts to answer my question as it's a "new version" of AdMob (as I said earlier)</em>.</p>