Skip to content Skip to sidebar Skip to footer

How To Get Google's Example Code Working For Admob 4.1.0 Using An Android Device

I want to use xml to add a banner ad to my app. To understand how to do this, I read through the Google AdMob Ads Android Banner XML tutorial. There's even example code. However, t

Solution 1:

There are some changes to the way Admob works in version 4.1.0

There's a discussion on Google Groups about this issue and how they haven't updated the documentation.

Google employee Tim posted:

1) Remove attrs.xml (or if you need it for your own custom attributes, remove the parts related to AdViews).

2) Change the namespace in your layout from xmlns:ads="http://schemas.android.com/apk/res/com.your.packagename" to xmlns:ads="http://schemas.android.com/apk/lib/com.google.ads"

Once you have made those two changes (along with the other changes you already made), you should now see an ad.

Post a Comment for "How To Get Google's Example Code Working For Admob 4.1.0 Using An Android Device"