Three days ago, madvertise officially announced the availability of their new SDKs for Android and iOS.
What has changed?
How to migrate?
First, install git.
Second, learn how to use git. Seriously.
Third: Clone the madvertise repository into your workspace or wherever you want it to be:
git clone git://github.com/madvertise/madvertise-android-sdk.git. In case you already cloned the repository once, pull the new changes.
Now switch to the new mad_mraid10- branch:
git checkout mad_mraid10
Import the SDK using new -> Android Project -> from existing source. In case you just pulled in step three, just select your madvertise SDK-project and hit F5. In the SDK Project you should now see a new class called MadvertiseMraidView.java. In the projects integrating the madvertise SDK as a source project, you should see some compile errors at the places where you implemented the MadvertiseCallbackListener. Add the unimplemented methods. They are:
public void onAdClicked()
public void onApplicationPause()
public void onApplicationResume()
onAdClicked() is, obviously, called when an ad is clicked by a user. In this method you can track ad clicks or reward your users by removing the ad for a couple of seconds. In case you want to do so I recommend something like
setFetchingAdsEnabled(boolean isEnabled) allows you to stop fetching ads for a given
MadvertiseView or to start it again.
onApplicationPause() is called when a rich media ad is expanded and the actual app content is not in the foreground anymore. The easyest construct here is to directly call
onPause() from this method.
onApplicataionResume() is the corresponding counterpart to
Lets look into the XML code, first into the attrs.xml. Here, add
< attr name="placement_type" format="string" /> and
< attr name="mraid" format="boolean" />. Obviously, you can include those values into your layout files as well:
Placement type declares how you plan to place your rich media ads. Interstitial is perfect when loading something and showing an ad in the meantime, for example full screen. Inline is more suitable for most of the other cases. With the mraid-attribute you declare whether you want rich media ads to be delivered to your app or not. In other words: If you want everything to stay the way it was, set
mad:mraid="false". The default for this attribute is true, so if you want rich media functionality, you can leave your layout files just the way they were. With one exception: In case you already upgraded to SDK tools in revision 17, you should now replace the ‘
And that’s already it.
madvertise’s eCPMs and fillrates really sucked in the last months. However, the company doesn’t give up and promises higher costs per click for the new rich media ads. I hope they keep their word and that the rich media ads won’t be too annoying. Let me know what you think (and hope) in the comments.