My brain is so full of Android app development that I don’t even know where to start. Here are a few small tidbits though:
Give Admob ads enough space
Admob ads won’t display if you don’t give them enough room. Specifically, 320dp x 48dp (dp = dip = density independent pixels). It won’t actually tell you that the ad won’t display – the debugger log will show that an ad was retrieved, but nothing shows up on the screen. Mobclix ads will show up in that space, but Admob ones won’t.
The problem was that I was squeezing the ad into half of the landscape screen. An ad comfortably fits across the top in portrait mode, but seems to be wasting space in landscape mode. I used the attribute android:layout_weight=”1″ for each of two columns and figured I had a clever solution to maximize space. Once I found the reference to the 320dp width requirement I recalculated — on my Motorola Droid the screen is 848 x 480. A little more obscure, at that resolution the ration of pixels to dp is 1.5:1. So, while I was giving 424px to the ad, it was only counted as 282dp. Hence, no display.
Maybe Admob mentioned this somewhere and I missed it. Either way, I updated my layout to ensure that Admob ads get enough space, and display works.
Rotate the screen
Another thing I had to search on. To rotate emulator, turn numlock of then press 7 or 9 to rotate to landscape and back. Now I can easily test how my app handles a rotation configuration change!