Custom Events - mobfox/MobFox-Android-SDK GitHub Wiki
Once a custom event is set up for a specific network, MobFox banners, interstitials and natives will get ads from that network in addition to ads from MobFox, increasing your fill rate.
Ad Network | Banner | Interstitial | Native |
---|---|---|---|
MoPub | Yes | Yes | Yes |
AdMob | Yes | Yes | Yes |
Smaato | - | - | - |
DFP | Yes | Yes | - |
AppLovin | - | Yes | - |
Chartboost | - | Yes | - |
AdColony | - | Yes | - |
Supersonic | - | Yes | - |
Vungle | - | Yes | - |
Woobi | - | Yes | - |
Yes | Yes | - | |
Amazon | Yes | Yes | - |
Millenial | Yes | Yes | - |
Startapp | Yes | Yes | - |
MoPub
- Install the MobFox Android SDK Core.
- Install the MoPub Android SDK.
- Place the MobFox-Android-MoPub-Adapter.jar in your application's libs folder (next to your src folder) and add it as a dependency in your gradle.build file.
- Setup MoPub Custom Events in your MobFox control panel.
- Integrate the Banner ,Interstitial or Native you created previously and load it - you should get an ad from the referred MoPub AdUnit.
AdMob
- Install the MobFox Android SDK Core.
- Install the AdMob Android SDK.
- Place the MobFox-Android-AdMob-Adapter.jar in your application's libs folder (next to your src folder) and add it as a dependency in your gradle.build file.
- Setup AdMob Custom Events in your MobFox control panel.
- Integrate the Banner, Interstitial or Native ads you created previously and load it - you should get an ad from the referred AdMob AdUnit.
- When expecting an AdMob Native ad please follow these instructions:
- Create a new layout in your res/layout folder. Call it
ad_app_installed
. - The layout's root element must be
com.google.android.gms.ads.formats.NativeAppInstallAdView
. - View components containing id's will be set with respected values if available.
- Recommended layout (optional):
<?xml version="1.0" encoding="utf-8"?>
<com.google.android.gms.ads.formats.NativeAppInstallAdView
xmlns:android="http://schemas.android.com/apk/res/android" android:layout_width="match_parent"
android:layout_height="wrap_content">
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_gravity="center"
android:background="#FFFFFF"
android:minHeight="50dp"
android:orientation="vertical">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="vertical"
android:paddingLeft="20dp"
android:paddingRight="20dp"
android:paddingTop="3dp">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="horizontal">
<ImageView
android:id="@+id/appinstall_app_icon"
android:layout_width="40dp"
android:layout_height="40dp"
android:adjustViewBounds="true"
android:paddingBottom="5dp" />
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="vertical">
<TextView
android:id="@+id/appinstall_headline"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:textSize="14sp"
android:textStyle="bold" />
<RatingBar
android:id="@+id/appinstall_stars"
style="?android:attr/ratingBarStyleSmall"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:isIndicator="true"
android:numStars="5"
android:stepSize="0.5" />
</LinearLayout>
</LinearLayout>
<LinearLayout
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:orientation="vertical">
<TextView
android:id="@+id/appinstall_body"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginRight="20dp"
android:textSize="12sp" />
<ImageView
android:id="@+id/appinstall_image"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:adjustViewBounds="true"
android:maxHeight="150dp"
android:paddingTop="5dp" />
<LinearLayout
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="right"
android:orientation="horizontal"
android:paddingBottom="10dp"
android:paddingTop="10dp">
<TextView
android:id="@+id/appinstall_price"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:paddingRight="5dp"
android:textSize="12sp" />
<TextView
android:id="@+id/appinstall_store"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:paddingRight="5dp"
android:textSize="12sp" />
<Button
android:id="@+id/appinstall_call_to_action"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:gravity="center"
android:textSize="12sp" />
</LinearLayout>
</LinearLayout>
</LinearLayout>
</LinearLayout>
</com.google.android.gms.ads.formats.NativeAppInstallAdView>
- In you application's layout add a container for the Native ad (FrameLayout - recommended).
id must befl_adplaceholder
:
<FrameLayout
android:id="@+id/fl_adplaceholder"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="16dp" />
- Finally, in your activity, pass the container to event.registerViewForInteraction:
@Override
public void onNativeReady(Native aNative, CustomEventNative event, NativeAd ad) {
// ...
FrameLayout fl_adplaceholder = (FrameLayout) findViewById(R.id.fl_adplaceholder);
event.registerViewForInteraction(fl_adplaceholder);
// ...
}
DFP
- Install the MobFox Android SDK Core.
- Install the DFP Android SDK.
- Place the MobFox-Android-DFP-Adapter.jar in your application's libs folder (next to your src folder) and add it as a dependency in your gradle.build file.
- Setup DFP Custom Events in your MobFox control panel.
- Integrate the Banner or Interstitial you created previously and load it - you should get an ad from the referred DFP AdUnit.
AppLovin
- Install the MobFox Android SDK Core.
- Install the AppLovin Android SDK.
- Place the MobFox-Android-AppLovin-Adapter.jar in your application's libs folder (next to your src folder) and add it as a dependency in your gradle.build file.
- Setup AppLovin Custom Events in your MobFox control panel.
- Place your AppLovin sdk key in your androidManifest.xml file as written in AppLovin documentation.
<meta-data android:name="applovin.sdk.key" android:value="<your-applovin-sdk-key>" />
There's no need to fill the 'netwrokId' field in MobFox console as the key is taken from the manifest file. - Integrate the Interstitial you created previously and load it - you should get an ad from the referred AppLovin SDK key.
Chartboost
- Install the MobFox Android SDK Core.
- Install the Chartboost Android SDK.
- Place the MobFox-Android-Chartboost-Adapter.jar in your application's libs folder (next to your src folder) and add it as a dependency in your gradle.build file.
- Setup Chartboost Custom Events in your MobFox control panel.
- Integrate the Interstitial you created previously and load it - you should get an ad from Chartboost.
AdColony
- Install the MobFox Android SDK Core.
- Install the AdColony Android SDK.
- Place the MobFox-Android-AdColony-Adapter.jar in your application's libs folder (next to your src folder) and add it as a dependency in your gradle.build file.
- Setup AdColony Custom Events in your MobFox control panel.
- It's only possible to request Interstitial custom event ads from AdColony at the moment. Create a MobFox Interstitial ad.
- Integrate the Interstitial ad you created previously and load it with the custom event publication ID (step 4) - you should get an ad from the referred AdColony ad.
Supersonic
- Install the MobFox Android SDK Core.
- Install the Supersonic Android SDK.
- Place the MobFox-Android-Supersonic-Adapter.jar in your application's libs folder (next to your src folder) and add it as a dependency in your gradle.build file.
- Setup Supersonic Custom Events in your MobFox control panel.
- Integrate the Interstitial you created previously and load it - you should get an ad from Supersonic.
Vungle
- Install the MobFox Android SDK Core.
- Install the Vungle Android SDK.
- Place the MobFox-Android-Vungle-Adapter.jar in your application's libs folder (next to your src folder) and add it as a dependency in your gradle.build file.
- Setup Vungle Custom Events in your MobFox control panel.
- It's only possible to request Interstitial custom event ads from AdColony at the moment. Create a MobFox Interstitial ad.
- Integrate the Interstitial ad you created previously and load it with the custom event publication ID (step 4) - you should get an ad from the referred Vungle ad.
Woobi
- Install the MobFox Android SDK Core.
- Download and Integrate the Woobi Android SDK, follow instructions in Here.
- While integrating Woobi SDK in your app keep the “appId” Woobi provides you.
- Place the Woobi-MobFox-1.0.0.jar in your application's libs folder (next to your src folder) and add it as a dependency in your gradle.build file.
- Configuring Wooib’s plugin:
Please set up Woobi’s plugin in your app, before calling MobFox’s Interstitial.load():
- To select interstitial Type: call WoobiMobFox.setWoobiAdToShow (WoobiMobFox.WOOBI_AD.) PrefferedIAdType = {VIDGET, DISPLAY, CAROUSEL}
- Set up Woobi’s AppId: provide the Woobi SDK integration appId to the plugin using the WoobiMobFox.setWoobiAppId method.
- Set up a clientId (optional): If you wish to set up a client id use WoobiMobFox.setWoobiClientId method.
- Setup Woobi Custom Events in your MobFox control panel and add Woobi as a "Custom Event".
- Integrate a MobFox Interstitial and load it with the custom event publication ID (step 4) - you should get an ad from the referred Woobi network.
- Install the MobFox Android SDK Core.
- Install the Facebook Android SDK.
- Place the MobFox-Android-Facebook-Adapter.jar in your application's libs folder (next to your src folder) and add it as a dependency in your gradle.build file.
- Setup Facebook Custom Events in your MobFox control panel.
- Integrate a MobFox banner or Interstitial and load it with the custom event publication ID (step 4) - you should get an ad from the referred Facebook network.
Amazon
- Install the MobFox Android SDK Core.
- Install the Amazon Android SDK.
- Place the MobFox-Android-Amazon-Adapter.jar in your application's libs folder (next to your src folder) and add it as a dependency in your gradle.build file.
- Setup Amazon Custom Events in your MobFox control panel.
- Integrate a MobFox banner or Interstitial and load it with the custom event publication ID (step 4) - you should get an ad from the referred Amazon network.
Millenial
- Install the MobFox Android SDK Core.
- Install the Millenial Android SDK.
- Place the MobFox-Android-Millenial-Adapter.jar in your application's libs folder (next to your src folder) and add it as a dependency in your gradle.build file.
- Setup Millenial Custom Events in your MobFox control panel.
- Integrate a MobFox banner or Interstitial and load it with the custom event publication ID (step 4) - you should get an ad from the referred Millenial network.
Startapp
- Install the MobFox Android SDK Core.
- Install the Startapp Android SDK.
- Place the MobFox-Android-Startapp-Adapter.jar in your application's libs folder (next to your src folder) and add it as a dependency in your gradle.build file.
- Setup Startapp Custom Events in your MobFox control panel.
- Integrate a MobFox banner or Interstitial and load it with the custom event publication ID (step 4) - you should get an ad from the referred Startapp network.