Skip to content
Asaf Gaber edited this page Feb 11, 2016 · 76 revisions

Adapters enable you to use the MobFox SDK inside other ad networks SDK's that you are using. This way you can display MobFox ads in addition to ads from other host networks.

MoPub

  1. Install the MobFox Android SDK Core.
  2. Install the MoPub Android SDK.
  3. Download the MobFox-Android-MoPub-Adapter.jar and Place it in your application's libs folder (next to your src folder).
  4. Add MobFox-Android-MoPub-Adapter.jar as a dependency in your gradle.build file.
  5. See the docs in MoPub for creating and integrating Banner / Interstitial ads.
  6. Create a MobFox publication.
  7. See the docs in MoPub for implementing custom networks on the MoPub ads previously created.
  8. For banner ads use this CUSTOM EVENT CLASS com.mobfox.sdk.adapters.MoPubBannerAdapter and in CUSTOM EVENT CLASS DATA input: {"invh":"<your-publication-hash>"} Use your required MobFox's publication hash.
  9. For interstitial (fullscreen) ads use this CUSTOM EVENT CLASS com.mobfox.sdk.adapters.MoPubInterstitialAdapter and in CUSTOM EVENT CLASS DATA input: {"invh":"<your-publication-hash>"} Use your required MobFox's publication hash. MoPub Set up Custom Native Network
  10. Now, when calling your MoPub ads, you should get the respective MobFox ads.

#AdMob

  1. Install the MobFox Android SDK Core.
  2. Install the AdMob Android SDK.
  3. 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.
  4. Declare AdMobInterstitialActivity in your application AndroidManifest.xml file. AndroidManifest.xml:
...

<activity android:name="com.mobfox.sdk.adapters.AdMobInterstitialActivity"
    android:label="@string/app_name">
</activity>

...
  1. In your AdMob control panel:
  • Click the Monetize tab.
  • Under All Apps select your app.
  • On the relevant Ad Unit, click the ad sources link.
  • Click the + New ad network button.
  • Do not select the MobFox network from the list but rather click the + Custom event button.
  • In the form fill:
    • Class Name -GADMAdapterMobFox or GADInterstitialAdapterMobFox for interstitial
    • Label - MobFox
    • Parameter - your MobFox publication hash

More AdMob custom event documentation can be found here: (https://developers.google.com/admob/android/custom-events).

  1. Integrate the AdMob Banner or Interstitial you created previously and load it - you should get an ad from the referred MobFox publication.

Clone this wiki locally