views:

1064

answers:

1

I am testing the AdMob for Android SDK. I can't set the admob:testing="true" because the admob attribute is unknown.

<LinearLayout
  xmlns:android="http://schemas.android.com/apk/res/android"
  xmlns:admob="http://schemas.android.com/apk/res/org.ifies.android"
  android:layout_width="fill_parent"
  android:layout_height="fill_parent"
  android:orientation="vertical"
  android:background="#FF000000"
  android:clickable="true"
>
  <com.admob.android.ads.AdView  
    android:id="@+id/admob" 
    android:visibility="visible"
    android:layout_width="fill_parent" 
    android:layout_height="100px"
    android:background="#FF0000"
    admob:testing="true"
  />
</LinearLayout>

My Eclipse is complaining that admob:testing="true" would have an unknown prefix. Anyone got an idea on how to fix this?

Sub question: Anyone got an idea how to change the height of the ad? It seems to be fixed to 48px, which is not looking good on any DROID phone...

+3  A: 

Might be worth checking that the error isn't due to something outside the file:

Make sure the package name you are using in your schema URI, "org.ifies.android", matches the value of the package attribute on the manifest element in AndroidManifest.xml.

Make sure res/values/attrs.xml has the attributes specified:

<?xml version="1.0" encoding="utf-8"?>
<resources>
    <declare-styleable name="com.admob.android.ads.AdView">
        <attr name="testing" format="boolean" />
        <attr name="backgroundColor" format="color" />
        <attr name="textColor" format="color" />
        <attr name="keywords" format="string" />
        <attr name="refreshInterval" format="integer" />
        <attr name="isGoneWithoutAd" format="boolean" />
    </declare-styleable>
</resources>
Lance Nanek
that fixed my noobish mistake.
stealthcopter