How To‎ > ‎

Android Mid Roll Integration

Steps to Integrate Full Screen & Custom Seventynine Ads at MidRoll

1.Copy SDK in libs folder

2.Copy mention two line of code in your mainActivity

Constants.strPublisherId ="";
DisplayBanners.contextAppContext = getApplicationContext();
SeventynineAdSDK seventynineAdSDK = new SeventynineAdSDK();                            seventynineAdSDK.init(this);


3.Add new service in Manifest file

                <service android:name="seventynine.sdk.ScreenCheck" />

4.Add 2 new activity in Manifest file
                     <activity  android:name="seventynine.sdk.DisplayAds"
                                    android:configChanges="keyboardHidden|orientation|screenSize" 
                     android:theme="@android:style/Theme.Light"/>

                    <activity  android:name="seventynine.sdk.InAppBrowser"
                                   android:configChanges="keyboardHidden|orientation|screenSize"
                                   android:noHistory="true" />

     5.Add following receiver  to your .manifest file within application tag
     
             <receiver android:name="seventynine.sdk.ReceiverScreen">
                  <intent-filter>
                       <action android:name="com.android.vending.INSTALL_REFERRER" />
                                        <action android:name="android.intent.action.PACKAGE_ADDED"/>
                                        <action android:name="android.intent.action.PACKAGE_REPLACED"/>

                                      <action android:name="android.intent.action.BOOT_COMPLETED" />

                                       <action android:name="android.intent.action.PACKAGE_REMOVED"/>
                                      <data android:scheme="package"/>
                              </intent-filter>
                      </receiver

    6.Add following permission in Manifest file

                   <uses-permission android:name="android.permission.GET_TASKS" />
                   <uses-permission android:name="android.permission.INTERNET" />
                   <uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />
                   <uses-permission android:name="android.permission.READ_PHONE_STATE" />
                   <uses-permission android:name="android.permission.ACCESS_COARSE_LOCATION" />
                   <uses-permission android:name="android.permission.ACCESS_FINE_LOCATION" />
                   <uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" />
            <uses-permission android:name="android.permission.GET_ACCOUNTS" /
                   <uses-permission android:name="android.permission.ACCESS_LOCATION_EXTRA_COMMANDS" />
                   <uses-permission android:name="android.permission.ACCESS_WIFI_STATE" />
                   <uses-permission android:name="android.permission.USE_CREDENTIALS"/>

    7. For full Screen ADs At MID ROLL (Between Two Activity)

    DisplayAds.strFirstActivityPath = "com.seventynine.tictactoe.TicTacToe";
    SeventynineAdSDK seventynineAdSDK = new SeventynineAdSDK();
    seventynineAdSDK.init(this);
    if(seventynineAdSDK.isAdReady("
    You can place your zone id here or leave it blank", this,""){
         Intent intent = new Intent();
         intent.setClass(this, DisplayAds.class);
         startActivity(intent);
      }
    8. For Native & Custom Ad Implementation(Place below code) 
            
             DisplayAds.strFirstActivityPath = "";
             SeventynineAdSDK seventynineAdSDK = new SeventynineAdSDK();
             if (seventynineAdSDK.isAdReady("
    You can place your zone id here or leave it blank"", TicTacToe.this,"")) {
                  (new DisplayAds()).customView(TicTacToe.this,
                  relativeLayout);
                 }


    9. For Audio Ad Implementation (Place below code) 

              DisplayAds displayAds = new DisplayAds();
               SeventynineAdSDK seventynineAdSDK = new SeventynineAdSDK();
              if (seventynineAdSDK.isAdReady("You can place your zone id here or leave it blank, TicTacToe.this,"audio")) {

                  displayAds.playAudioAd(getApplicationContext(), "You can place your zone id here or leave it blank");

             } 


    Comments