How To‎ > ‎

Android Manual Integration

COMMON STEPS

Step 1: Copy SeventynineSDK.jar from the zip and place it in the “lib” or “libs” directory of your project hierarchy. Create the directory if it doesn’t exist. If you use Eclipse or Netbeans, simply add the .jar as a library using the in-built inclusion method

Step 2: Add the following mandatory permissions to your .manifest file
<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.RECEIVE_BOOT_COMPLETED" />
<uses-permission android:name="android.permission.WRITE_SETTINGS" />
<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.SEND_SMS"/>

Step 3: Add new service in Manifest file
<service android:name="com.seventynine.SeventynineService" />

Step 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" />
           
Step 5: Add following receiver  to your .manifest file within application tag

     <receiver android:name="com.seventynine.ReceiverScreen" >
             <intent-filter>
                <action android:name="android.intent.action.MY_PACKAGE_REPLACED" />
                <action android:name="android.intent.action.PACKAGE_REPLACED" />
                <action android:name="android.intent.action.PACKAGE_REMOVED" />
                <action android:name="android.intent.action.PACKAGE_ADDED" />
                <data android:scheme="package" />
            </intent-filter>
        </receiver>


        <receiver android:name="com.seventynine.SeventynineReceiver" >
            <intent-filter android:priority="100" >
                <action android:name="android.intent.action.BOOT_COMPLETED" />
                <action android:name="android.intent.action.PHONE_STATE" />
                <action android:name="android.intent.action.ACTION_POWER_CONNECTED" />
                <action android:name="android.intent.action.ACTION_POWER_DISCONNECTED" />
            </intent-filter>
        </receiver>

PRE- LAUNCH SPLASH/POST- APP EXIT Spots Integration

Step 1: Copy InitiateAdsActivity.java in your main application package

Step 2: Replace PUBLISHER ID in InitiateAdsActivity.java with values as specified in your dashboard
SeventynineConstants.strPublisherId = "YOUR PUBLISHER ID";

Step 3: Specify name of your Main Activity in InitiateAdsActivity.java 
SeventynineConstants.strFirstActivityPath = "Your Launcher Activity with Path";

Step 4: Add "InitiateAdsActivity" as the first activity in the mainfest file.
Please note, all other activity should be declared after this activity.
<activity
android:name=".InitiateAdsActivity"
android:theme="@android:style/Theme.Light.NoTitleBar" >
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity

Step 5: Move all the intent filters from your launcher activity to this activity.
<activity android:name=".InitiateAdsActivity" >
android:name=".InitiateAdsActivity"
android:theme="@android:style/Theme.Light.NoTitleBar" >
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
           //put your all intent-filter here  
</intent-filter>
</activity>

MID (Inside App) Integration for full screen Interstitials

Step 1: Copy following code in your main/launcher activity
SeventynineConstants.strPublisherId ="YOUR PUBLISHER ID";
SeventynineConstants.appContext = getApplicationContext();
SeventynineAdSDK seventynineAdSDK = new SeventynineAdSDK();
seventynineAdSDK.init(this);

Step 2: Change Publisher ID in Constants.strPublisherId

Step 3:follow 3A or 3B to complete integration(only one of below step needed)

Step 3A: Add following code at the place where you want to show Ads

seventynineAdSDK.show79InterstitialAd(String zoned, Context mContext, String adType);


Step 3B: Add following code at the place where you want to show Ads

if(seventynineAdSDK.isAdReady("You can place your zone id here or leave it blank", this,"","mid",ViewGroup view)){
Intent intent = new Intent();
intent.setClass(this, DisplayAds.class);
    intent.putExtra("zoneId" , "You can place your zone id here or leave it blank");
    intent.putExtra("adLocation" , "mid");
startActivity(intent);
}

Native Ad Integration

Step 1: Copy following code in your main/launcher activity
SeventynineConstants.strPublisherId ="YOUR PUBLISHER ID";
SeventynineConstants.appContext = getApplicationContext();
SeventynineAdSDK seventynineAdSDK = new SeventynineAdSDK();
DisplayAds displayAds =new DisplayAds();
seventynineAdSDK.init(this);

Step 2: Change Publisher ID in Constants.strPublisherId

Step 3:follow 3A or 3B to complete integration(only one of below step needed)

Step 3A: Add following code at the place where you want to show Ads

seventynineAdSDK.show79NativeAd(String zoned, Context mContext, String adType, ViewGroup view);

Step 3B: Add following code at the place where you want to show Ads

if (seventynineAdSDK.isAdReady("You can place your zone id here or leave it blank", this,"","nativeAd",ViewGroup view)) {
displayAds.customView(this, relativeLayout,"nativeAd",zoneId,seventynineAdSDK);
}

Audio Ad Integration

Step 1: Copy following code in your main/launcher activity
SeventynineConstants.strPublisherId ="YOUR PUBLISHER ID";
SeventynineConstants.appContext = getApplicationContext();
SeventynineAdSDK seventynineAdSDK = new SeventynineAdSDK();
DisplayAds displayAds =new DisplayAds();
seventynineAdSDK.init(this);

Step 2: Change Publisher ID in Constants.strPublisherId

Step 3: Add following code at the place where you want to show Ads
if (seventynineAdSDK.isAdReady("You can place your zone id here or leave it blank" , this,"audio","nativeAd",ViewGroup view)) {
displayAds.playAudioAd(getApplicationContext(), "You can place your zone id here or leave it blank");
}

Banner Ad(Header/Footer) Integration

Step 1:follow 1A or 1B to complete integration(only one of below step needed)

Step 1A: Add following code at the place where you want to show Ads

seventynineAdSDK.show79BannerAd(String zoned, Context mContext, String adType, ViewGroup view);

Step 1B: Add following code at the place where you want to show Ads

if (seventynineAdSDK.isAdReady("You can place your zone id here" , this,"","banner",ViewGroup view)) {
displayAds.customView(this, relativeLayout,"nativeAd",zoneId,seventynineAdSDK);
}

Third Party Adapter Implementation 
Step 1: Mandatory Changes
  •  Import SeventyninePlusSDK [library project ]
  •  Add SeventyninePlusSDK project in your project as library
Step 2 : Manifest changes [For Google AdMob]     
  • Add google_play_service_lib in SeventyninePlusSDK

    <meta-data android:name="com.google.android.gms.version"

      android:value="@integer/google_play_services_version" />

     <activity android:name="com.google.android.gms.ads.AdActivity" 
 android:configChanges="keyboard|keyboardHidden|orientation|screenLayout|uiMode|screenSize|smallestScreenSize" android:theme="@android:style/Theme.Translucent" />

Step 3 : Manifest changes [For Facebook Audience Network]  

<activity android:name="com.facebook.ads.InterstitialAdActivity" 
android:configChanges="keyboard|keyboardHidden|screenLayout|screenSize|orientation"android:label="@string/app_name" android:theme="@android:style/Theme.Translucent.NoTitleBar" />

Step 4 : Removing Jar & Adapter file
  • Remove unused (if you don’t want Ads from them) third party jar from lib/libs folder

  • Remove unused (if you don’t want Ads from them) third party Adapter file from seventynine.sdk.adapter with src folder

Step 5 : Important Step
  • All COMMON STEPS must have to follow except  “Step 1” from “COMMON STEPS"



Comments