This library depends on Google Play Services which is a requirement of AdMob as the old SDK has been deprecated as of August 1st, 2014. Only API level 9 (Android 2.3) or higher is supported.
Prior to integration, be sure that your application is setup to include Google Play Services. Instructions on how to configure the library can be found at http://developer.android.com/google/play-services/setup.html.
- Clone our repository to your machine locally or download the latest release as a zip file from: https://github.com/mantisadnetwork/mantis-android-admob/archive/master.zip
- Import the project into your application workspace (File > Import > Android > Existing Android Code Into Workspace)
- On your android application, open the Android properties screen (File > Properties > Android) and add the recently imported project as a library.
If you have never integrated into the AdMob SDK before, you can take a look at our example project that shows you how to not only configure AdMob, but to configure the required MANTIS values. https://github.com/mantisadnetwork/mantis-android-admob-example/
To get started, the only thing you need to do is configure the MANTIS context with the property ID found in your MANTIS administration panel. Typically, this call is done in your main activity, prior to any AdMob initialization.
import com.mantisadnetwork.android.admob.Context;
Context.get().setPropertyId("property-id-found-in-admin");
After updating your application to include the MANTIS mediation library, you must now configure mediation per ad unit in the AdMob interface. Here is a breakdown of each setup if creating an ad unit from scratch.
The AdMob "ad unit" is the equivelant of a "zone" on the MANTIS platform. For each ad unit you configure, you should already have a zone configured through the MANTIS administration panel.
Currently, we only support the "Banner" ad format with the "Image" ad type. Whether you refresh the ads are up to you and we have no restriction on the ad unit name.
This ID is used within your application to display the AdMob banner (regardless of whether you use MANTIS or not). See our example application for an example of where to plug this in.
After creating the ad unit, Admob should then take you back to your list of ad units for the application. Find the one you just created and "Edit mediation".
Each ad unit is configurable to allow for any combintation of ad networks. You could in theory use one ad unit with just AdMob and another with just MANTIS advertisements. To continue, select "New ad network".
Because MANTIS isn't an official AdMob partner, you will need to configure mediation with us through a "Custom event".
Once selected, a form will appear and prompt you to fill out the following fields:
com.mantisadnetwork.android.admob.Mediation
Feel free to name this what you wish, but to keep it consistent we recommend:
MANTIS Ad Network
The parameter you pass to our mediation class should be the MANTIS zone id that is provided to you within our interface.
Once we've been setup as an ad network on your ad unit, you have to make a few changes to ensure we display.
- Disable the "Optimize AdMob Network" option. Until you have enough data from our reporting interface to tell you what your eCPM is, you will want to keep this turned off.
- Enter a number in the Default eCPM field that is HIGHER than the AdMob network field. Currently, there is no automated way to update this value or track from AdMob.
After making those changes, be sure to hit save at the top!
You are now ready to serve ads from MANTIS! Feel free to submit any pull requests for enhancements or create issues here on github.