I am trying to integrate AdMob into my Android Application, and can get it to work fine in the simulator when using the default sample layout code to position AdMob at the bottom of the screen, however whenever I try to position it to the top of the screen no adverts get served. I have read that this could perhaps be due to lack of space for the adverts.
This code works at the bottom of the screen (portrait):
<RelativeLayout
android:id="@+id/InnerRelativeLayout"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentBottom="true" >
<com.admob.android.ads.AdView
android:id="@+id/ad"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
app:backgroundColor="#000000"
app:primaryTextColor="#FFFFFF"
app:secondaryTextColor="#CCCCCC"
android:layout_alignParentBottom="true"
/>
</RelativeLayout>
But when I try to position it at the top it does not work
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout
android:id="@+id/widget40"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:orientation="vertical"
xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res/com.myapp.xxxx"
>
<RelativeLayout
android:id="@+id/InnerRelativeLayout"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentTop="true" >
<com.admob.android.ads.AdView
android:id="@+id/ad"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
app:backgroundColor="#000000"
app:primaryTextColor="#FFFFFF"
app:secondaryTextColor="#CCCCCC"
android:layout_alignParentTop="true"
/>
</RelativeLayout>
<TextView
android:id="@+id/widget28"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:text="Input Amount:"
android:layout_marginLeft="10dip"
android:layout_marginTop="10dip"
android:layout_marginRight="10dip"
android:textSize="16dip"
android:textStyle="bold">
</TextView>
Any help would be appreciated.
Thanks Aaron