Mopub Android Wrapper

Jump to: navigation, search

Pokkt Integration to MoPub

Last Update: 6th June, 2018

Pokkt SDK version required: 7.2.0

MoPub SDK version used: 5.0.0

Download Latest Version MoPub Wrapper.

Step 1: Getting Started

The following instructions assume you have already integrated MoPub SDK into your application.

Step 2: Adding Your Application to Your Pokkt Publisher's Account

  • Create Account and log-in at
  • Add your application and get its application Id and Security key.

Step 3: Pokkt Integration



  • Add PokktSDK_v7.2.0.aar or PokktSDK_v7.2.0.jar to your project.
  • Download PokktMoPubCustomBanner, PokktMoPubCustomInterstitial and PokktMoPubCustomRewardedVideo from Pokkt site and place it under com.mopub.mobileads package in your project structure. OR Download our Wrapper jar and place in your project.


Permissions Declarations

Add the following permissions to your project manifest

  1. Mandatory permissions.

    <uses-permission android:name="android.permission.INTERNET"/>
    <uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />
    • android.permission.INTERNET = Required for SDK communication with server.
    • android.permission.ACCESS_NETWORK_STATE = Required to detect changes in network, like if WIFI is available or not.
  2. Optional permissions.

    <uses-permission android:name="android.permission.WAKE_LOCK" />
    <uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" />
    <uses-permission android:name="android.permission.WRITE_CALENDAR" />
    <uses-permission android:name="android.permission.ACCESS_COARSE_LOCATION" />
    <uses-permission android:name="android.permission.ACCESS_FINE_LOCATION" />
    <uses-permission android:name="android.permission.CALL_PHONE" />
    <uses-permission android:name="android.permission.SEND_SMS" />
    <uses-permission android:name="android.permission.VIBRATE" />
    • android.permission.WAKE_LOCK = Required to prevent device from going into the sleep mode during video play.
    • android.permission.WRITE_EXTERNAL_STORAGE = Required to store media files related to ads in external SD card, if not provided we will use app cache folder to store media files, which will result in unnecessary increase in application’s size. It is recommended to ask for this permission as low end devices generally have less internally memory available.
    • android.permission.WRITE_CALENDAR = Some Ads create events in calendar.
    • android.permission.ACCESS_COARSE_LOCATION" = Some Ads show content based on user’s location.
    • android.permission.ACCESS_FINE_LOCATION = Some Ads show content based on user’s location.
    • android.permission.CALL_PHONE = Some Ads are interactive and they provide you a way to call directly from the content.
    • android.permission.SEND_SMS = Some Ads are interactive and they provide you a way to send message.
    • android.permission.VIBRATE = Some Ads provide haptic feedback, so as to maintain their behaviour we need this permission

Activity Declaration

Add the following activity in your AndroidManifest for Pokkt SDK integration.

   android:windowSoftInputMode="stateAlwaysHidden|adjustUnspecified" />

You can change the android screenOrientation landscape to portrait of your choice, the way you want to display the ads.

Service Declaration

Add the following service in your AndroidManifest for receiving InApp notifications.


Step 4: Adding a Custom Event

  1. Sign in to your MoPub account at
  2. Click Add a network under Networks tab.

    Mopub network andr.jpg

  3. Click Custom Native Network and set up the inventory against your app.
    Mopub custom net andr.jpg
  4. Provide the following details:
    • Custom Event Class:Enter the name of the custom event class.
      • For Rewarded Video: Enter com.mopub.mobileads.PokktMoPubCustomRewardedVideo
      • For Interstitial: Enter com.mopub.mobileads.PokktMoPubCustomInterstitial
      • For Banner: Enter com.mopub.mobileads.PokktMoPubCustomBanner
    • Title:Enter the name for the custom event. This is used in reporting and cannot be changed later.
    • Custom Event Class Data:Enter a JSON string as follows:

      "POKKT_SCREEN_NAME":"Screen Created on Pokkt Dashboard",
      "POKKT_APP_ID":"Pokkt App Id",
      "POKKT_SEC_KEY":"Pokkt App Security Key",
      "POKKT_THIRD_PARTY_USERID":"Unique user id as in your app",
      "POKKT_REWARD_NAME":"Virtual currency As per your App",
  5. Click Save Section.
  6. Open Global segment and enable the newly created Ad Network against the ad units of your app.

    Mopub segment andr.jpg

Step 5: Testing your application

Congratulation - that's it! You may now run your app and see Pokkt ads in action.