I've included the relevant portion in my manifest:
<meta-data android:value="123456789" android:name="ADMOB_PUBLISHER_ID" />
<!-- Track Market installs from AdMob ads -->
<receiver android:name="com.admob.android.ads.analytics.InstallReceiver" android:exported="true">
<intent-filter>
<action android:name="com.android.vending.INSTALL_REFERRER" />
</intent-filter>
</receiver>
<meta-data android:value="true" android:name="ADMOB_ALLOW_LOCATION_FOR_ADS" />'
and
<uses-sdk android:minSdkVersion="3" />
<uses-permission android:name="android.permission.INTERNET" />
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE"/>'
attrs copied right from the example:
<?xml version="1.0" encoding="utf-8"?>
<resources>
<declare-styleable name="com.admob.android.ads.AdView">
<attr name="backgroundColor" format="color" />
<attr name="primaryTextColor" format="color" />
<attr name="secondaryTextColor" format="color" />
<attr name="keywords" format="string" />
<attr name="refreshInterval" format="integer" />
</declare-styleable>
</resources>
My layout (Which is a tabs view btw) is a table with it on its own row:
xmlns:app="http://schemas.android.com/apk/res/com.icukansas.lenscalculator"
and
<TableRow>
<!-- Place an AdMob ad at the bottom of the screen. -->
<!-- It has white text on a black background. -->
<com.admob.android.ads.AdView
android:layout_span="4"
android:id="@+id/ad"
app:backgroundColor="#000000"
app:primaryTextColor="#FFFFFF"
app:secondaryTextColor="#CCCCCC"
app:keywords="security"
/>
</TableRow>
I then call:
public class myClass extends Activity implements AdListener{
public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState);
setContentView(R.layout.tab_thistab);
AdView ad = (AdView) findViewById(R.id.ad);
ad.setAdListener(this);
Every time I get onFailedToReceiveAd error in the log.
I'm sure its something easy I'm missing :)