Single Line Integration of Media.Net Header Bidder for DFP & MoPub

Do go through the steps in our Getting Started Guide to add Media.Net SDK into your project before starting the integration of Header Bidder for DFP or MoPub.

Follow these simple steps for the integration:

First, add the following dependency to your main Gradle file.

   dependencies {
    classpath ""

Second, apply the plugin to your application Gradle file.

   apply plugin: ""

Third and finally, add the below single-line code to your application Gradle file depending upon your preference. You can always add both.


   compile ""

Passing custom data through DFP Header Bidder

Custom data like user-details, location-details and context-link can be sent into the AdRequest object, through certain parameters, which will be picked up by the MNet ad-views to contextualize the mediation-ads.

NOTE: this process is equivalent in both Banner and Interstitial ads.

Here is an example for setting the user and location details in the AdRequest object

    final AdRequest adRequest = new AdRequest.Builder()

For MoPub

   compile ""