GoogleAdMobAdsSdkAndroid-4.3.1 on older Platforms

248 views
Skip to first unread message

Reiner

unread,
Oct 28, 2011, 10:30:53 AM10/28/11
to Google AdMob Ads Developers
The actual SDK does not compile on older platforms. Setting the target
to 13 may fix it but it is not really a good solution! I think if they
check the android:configChanges attributes they must also check the
Android API version! Where can download the latest SDK not using
target=13

Thanks
Reiner

Eric Leichtenschlag

unread,
Oct 28, 2011, 12:40:34 PM10/28/11
to google-adm...@googlegroups.com
You can still run your application with v4.3.1 on older platforms all the way down to Android 1.5.  You just have to set the minSdkVersion in your manifest file to the minimum version your app supports.

Eric, AdMob SDK Support

Jim

unread,
Oct 28, 2011, 3:01:35 PM10/28/11
to Google AdMob Ads Developers
Reiner,

I think this is not clear with Android, but they document that Target
API and Minimum API can be different. Here is the reference:

http://developer.android.com/guide/developing/projects/projects-eclipse.html

Essentially, the target API allows your IDE (e.g. Eclipse) to include
appropriate Android OS libraries and build the project using those.
The various Android releases have changes that may or may not impact
those builds.

A good example to me was the change from Contacts (API 1 through 4) to
ContactsContract (API 5+). Specifying the correct target API is
essential so that the classes/methods you use have both forward and
backward compatibility. Using this example, I built two methods for
accessing contact data (one for Contacts, the other for
ContactsContract), then select the appropriate method to use by
checking the device API at runtime. I cannot, however, use a target
API lower than 5 to build my project because the libraries for
ContractsContract are not in the older API's. For example, in one of
my projects that does this, the minimum API is 4, but the target API
is 8 (for other reasons).

As another example, the HTTP Transport implementation for Google API's
Client Library has different code depending on the both the target API
and minimum API for your project. The documentation is here:

http://code.google.com/p/google-api-java-client/wiki/Android

So, just because the target API is 13 or 14, the minimum Android API
can be 3. When the APIs are different, it must be tested. AdMob
clearly has done that, so we should be fine (I will test all APIs
anyway, and I suggest all developers do the same, but that's because
apps may break for reasons that AdMob may not be able to test, or
under rare conditions that were not obvious to test).

-Jim

Jim

unread,
Oct 28, 2011, 3:30:48 PM10/28/11
to Google AdMob Ads Developers
Also, my comment sounds like it describes the minSdkVersion in the
Manifest.xml and the Eclipse Target API. I should clarify that the
"targetSdkVersion" in the manifest is not the same as the
default.properties/Eclipse "Project Build Target" - specifying a
manifest targetSdkVersion different from your Project Build Target can
result in errors.

The Android Market and device installation process rely on the
Manifest, while Eclipse does the actual build based on what you tell
it in default.properties. Eclipse will give you a warning if they are
different, but it will still compile. They should be the same, but in
rare cases I test things and they need to be different.

FYI - I edit my Build Target by right-clicking on the project, select
"properties" then "Android" instead of editing the default.properties
file.

-Jim

On Oct 28, 9:30 am, Reiner <reiner.pro...@gmail.com> wrote:

Stephen Milone

unread,
Oct 29, 2011, 9:36:51 AM10/29/11
to google-adm...@googlegroups.com
i was able to get the new admob sdk setup and compiling as suggested above...however when I run my program in a 1.6 virtual device...no ad shows up. I run it in a 4.0 one it shows up...did this in admob requirements break ads from showing in older platforms??

Eric Leichtenschlag

unread,
Oct 31, 2011, 8:06:05 PM10/31/11
to google-adm...@googlegroups.com
Thanks for the report.  We are looking into this issue.  I've been able to reproduce this myself in the 1.6 emulator.  However, our 1.6 test device, as well as the 1.5 and 2.2 emulators that I've tested, all served ads.  In the meantime I'd recommend testing on a non-1.6 emulator.

Cheers,
Eric, AdMob SDK Support

Jim

unread,
Nov 1, 2011, 12:43:46 AM11/1/11
to Google AdMob Ads Developers
To add to the complexity, I get banner ads on 1.6 (API 4) with the
4.3.1 SDK. For me it worked when I did the build test against both API
13 and 14.

Even so, apparently there is still a bug, maybe the same one...

I got a UsageStatsService error ("Unknown URL context: //
android.server.checkin/events") that crashed the app. I'm not certain,
but the catlog makes it look like the problem was with the Ad thread.
It happened when I have a configuration change and I override the
onConfigurationChanged Activity method (since these are banner ads,
this should not be related to the new Manifest configChanges, but
maybe it is - regardless, my manifest includes all the required
configChanges types).

It did not crash during a configChange on the same activity/same code
with my test on API 8 (built against API 13). I currently don't have
apps that have minSDK as API 3, so I don't know if this is related to
the above problem. UsageStatsService was introduced with API 3, but
had several changes before and after API 4. It could be that the SDK
works everywhere except API 4... I also verified that the 4.1.1 SDK
does not have the same problem for API 4 or 8 (just in case I missed
it up to this point... and those are the only API's I tested at this
point; I know I tested more for 4.1.1).

Any other crashes out there after an onConfigurationChanged override?

-Jim

On Oct 31, 7:06 pm, Eric Leichtenschlag <eleichtens...@google.com>
wrote:
Reply all
Reply to author
Forward
0 new messages