For some reason, I’m getting nothing while running my AdMob in test mode. Can anyone see anything blatantly wrong?
XML:
<?xml version="1.0" encoding="UTF-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:ads="http://schemas.android.com/apk/lib/com.google.ads"
android:layout_width="fill_parent"
android:layout_height="fill_parent" >
<com.google.ads.AdView android:id="@+id/ad"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
ads:adSize="BANNER"
ads:adUnitId="AD_ID"
ads:testDevices="TEST_EMULATOR,TEST_EMULATOR, DEVICE_ID"
ads:loadAdOnCreate="true"/>
<ImageView
android:id="@+id/image"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:layout_centerHorizontal="true"
android:layout_centerVertical="true"
android:src="@android:drawable/alert_light_frame" />
</RelativeLayout>
and then my activity doesn’t have anything in it, since loadAdOnCreate is true.
So I figured out what the issue was! I was running this on a 2.3 phone, which is below the necessary Android version for AdMob. When I ran it inside a 4.0 VM, it worked fine!
My tip to people trying to find out what’s wrong with their AdMob: use it in a straight XML fashion (above code), since this factors out any problems with your Java. Then try it in VMs instead of physical devices, and read the LogCat to look for any problems. Hope this helps!