AdMob 4.0.4 Tutorial
People have been asking me to take a look at the latest AdMob SDK, version 4.0.4. Some have been having trouble getting it to work and other’s have had problems getting test ads to show up.
I did some digging and I put together a working template. I won’t go through the entire process of creating this. Please reference my other two tutorials if you want a full walkthrough. I’ll just point out the changes and I’m also including the source as always on my download page at http://taiic.com/downloads.
So it looks to me that one of the major differences is that they have moved the ability to configure most of the settings to xml, and are now using a smaller footprint in the java file. Here is all the code that is needed in the .java.
Ok, so here is where the testing part has changed. At first I was hitting my head against the wall wondering why this isn’t working, and then I stumbled across this.
Specifically, “It’s ignored on devices so there’s no need to worry about leaving it in production.” So…I unplugged my phone, loaded up in the emulator and presto, I had a test ad.
My guess is they had one to many support complaints about test ads loading in live apps and decided to remove that possibility all together.
The other change is in the attrs.xml file. It now looks like this.
The main.xml layout file is now a little different also.
Notice how it uses the attributes defined in the attrs.xml, adUnitID and adSize.
And finally, the AndroidManifest.xml has been cleaned up as well.
The following shows up above the tag.
And before the tag.
Don’t forget to grab the source in my downloads at http://taiic.com/downloads
Join our community on facebook. Just hit the Like in the left sidebar (towards the top of the page), this button
Or directly on our fb page at http://www.facebook.com/pages/tAIICcom/116243311786911