Search code examples
android-emulatoradmobandroid-version

Admob and API version 8


I develop on an.. let's say: not ultramodern computer, and were doing fine so far developing with the emulator for API version 8. Now I try to use Admob (after meddling with "Adsense for Mobile Apps" which never displayed any ads for some reason), but it turns out that I need an API target of 13 to use it. Is there any way to get it to run with 8?

In my Manifest file, I have defined

<uses-sdk android:minSdkVersion="8" android:targetSdkVersion="15" />

already. After my investigations and the tips I have read so far, I tried the 'reduced' set for the Android Manifest,

<activity android:name="com.google.ads.AdActivity"      android:configChanges="keyboard|keyboardHidden|orientation" />

but running it on the v8 emulator produces a number of exceptions basically complaining that the required configChanges are not set. I have read about a 'trick' of using an older Admob SDK, but also the warning of Google that from end of 2011, they won't display ads anymore and the new version must be used.

The worst thing is that I can't even run my own app on my connected mobile phone (HTC Legend, v2.3.7 / API 10) if I want to use Admob?!

Or maybe I am missing something, am quite frustrated right now.


Solution

  • There is a way. Check out this blog post, which applies to AdMob SDK 6.0 as well.

    The TL;DR:

    Set target in project.properties to android-13 or higher. You need the full set of configurations:

     <activity android:name="com.google.ads.AdActivity"
               android:configChanges="keyboard|keyboardHidden|orientation|screenLayout|uiMode|screenSize|smallestScreenSize"/>
    

    As long as minSdkVersion is 8, you can still run on Android 2.2.