Follow

SDK Documentation

DOCUMENT REVISION: 001

This document describes how to install, configure and implement EZMob's Monetization SDK.
Currently the SDK kit available only on the Android platform.

Project Settings (Android Studio)

Gradle Build Settings

Find your application's build.gradle file (not project's build.gradle). Append the following setting in the corresponding sections:

repositories{
flatDir{
dirs 'libs'
 }
}
dependencies {
compile 'com.google.android.gms:play-services:7.0.0'
compile fileTree(dir: 'libs', include: ['*.jar'])
compile(name:'Ajillion_Ads_SDK', ext:'aar')
}

AndroidManifest.xml Settings

<manifest ...>
    <uses-permission android:name="android.permission.INTERNET" />
    <uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" />
    <uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />
    <uses-permission android:name="android.permission.ACCESS_COARSE_LOCATION" />
    ....
</manifest> 

Google Play Services

<application ... >
    <meta-data android:name="com.google.android.gms.version" android:value="@integer/google_play_services_version"/>
</application>

AD Units

AD Unit Sizes (SDK)

  • AdSizes.BANNER
  • AdSizes.FULL_BANNER
  • AdSizes.LARGE_BANNER
  • AdSizes.EXTRA_LARGE_BANNER
  • AdSizes.BOOKMARK
  • AdSizes.LEADERBOARD

Interstitial Unit 

/**
 * Set EZMob Publisher ID (MANDATORY)
*/
public Builder setEzMobComponent(String ajId)

 

/**
 * If preferring to receive callbacks straight to activity containing the interstitial,
* activity should implement InterstitialAdListener and send "this" as a parameter in the following method.
 */
public Builder setInterstitialListener(InterstitialAdListener listener)

 

/**
 * If it is preferred that interstitial will dismiss itself after a few seconds,
* those 2 methods should be set accordingly
 */
public Builder setShowGeneratedUrlEnabled(boolean autoDismissEnabled) public Builder setAutoDismissTimeMilliSeconds(int milliSec)

 

/**
 * Builds shows the generated url in a dialog (for debug purposes)
 */
public Builder setShowGeneratedUrlEnabled(boolean showGeneratedUrlEnabled)

 

/**
 * Loads the interstitial
*/
public AjillionInterstitial build()

Example:

AjillionInterstitial interstitial = new AjillionInterstitial.Builder(this)
.setEzMobComponent("2714")
.setAutoDismissEnabled(false)
.setGender(Gender.FEMALE)
.setShowGeneratedUrlEnabled(true)
.build(); 
interstitial.loadInterstitial();

PopUp Unit

/**
 * Set EZMob Publisher ID (MANDATORY)
*/
public Builder setEzMobComponent(String ajId)

 

/*
 * If preferring to receive callbacks straight to activity containing the popup,
* activity should implement AdPopupListener and send "this" as a parameter in the following method
 */ 
public Builder setAdPopupListener(AdPopupListener adPopupListener)

 

/**
 * Builds an AjillionPopup object
 */
public AjillionPopup build()

 

/**
 * Loads the Pop­up AD
 */
public void loadAd()

Example:

AjillionPopup ajillionPopup = new AjillionPopup.Builder(this)
        .setEzMobComponent("2714")
        .setGender(Gender.MALE)
        .setSize(AdSizes.BANNER)
        .build();
ajillionPopup.loadAd();

Banner Unit

/**
 * Constructors
 */
public AjillionView(Context context)
public AjillionView(Context context, AttributeSet attrs)
public AjillionView(Context context, AttributeSet attrs, int defStyle)

 

/**
 * Set EZMob Publisher ID (MANDATORY)
*/
public Builder setEzMobComponent(String ajId)

 

/**
 * Loads the Pop­up AD
 */
public void loadAd()

Example:

Include the following XML block to your Activity’s or Fragment’s layout.
The expected dimensions for a banner ad are screen width and 50dp high; these should not be modified.

<com.ajillion.view.AjillionView
    android:id="@+id/ajView"
    android:layout_width="match_parent"
    android:layout_height="50dp"
    android:layout_alignParentBottom="true" />

Then, In your Activity’s onCreate() method or your Fragment’s onCreateView() method, set your AjillionView like this:

AjillionView ajView = (AjillionView) findViewById(R.id.ajView);
ajView.setVisibility(View.VISIBLE);
ajView.setEzMobComponent("2714");
ajView.setAdBannerListener(this);
ajView.setGender(Gender.FEMALE);
ajView.setBannerType(AdSizes.BANNER);
ajView.loadAd();

Important: When the hosting Activity or Fragment is destroyed, be sure to also destroy the AjillionView by calling:

ajillionView.destroy();

Bookmark Unit

/**
 * Constructors
 */
public AjillionBookmark(Context context)
public AjillionBookmark(Context context, AttributeSet attrs)
public AjillionBookmark(Context context, AttributeSet attrs, int defStyle)

 

/**
 * Set EZMob Publisher ID (MANDATORY)
*/
public Builder setEzMobComponent(String ajId)
/**
 * Setters of bookmarks slide down/fade out/disappearance timings
 */
public void setBookmarkSlideDownDuration(long durationMillisec)
public void setBookmarkAlphaOutDuration(long durationMillisec)
public void setBookmarkTimeBeforeDisappearance(long durationMillisec)
/**

Example:

AjillionBookmark ajillionBookmark = new AjillionBookmark(this);
ajillionBookmark.setEzMobComponent("2714");
ajillionBookmark.setBannerType(AdSizes.BOOKMARK);
ajillionBookmark.loadAd();

Common Public Methods

Note: return value is Builder in case of Interstitial and Popup ads, void in case of Bookmark and Banner ads.

/**
 * Various methods to send "keywords" parameters inside the request which will be sent to Ajillion
 */
public Builder setKeywords(String... keywords)
public Builder setKeywords(ArrayList<String> keywords) public Builder setKeywords(String keywords)
 
/**
 * Various methods to send "channels" parameters inside the request which will be sent to Ajillion
 */
public Builder setChannels(String... channels)
public Builder setChannels(ArrayList<String> channels) public Builder setChannels(String channels)
 
/**
 * Various methods to send "segments" parameters inside the request which will be sent to Ajillion
 */
public Builder setSegments(String... segments)
public Builder setSegments(ArrayList<String> segments) public Builder setSegments(String segments)
 
/**
 * Set "gender" parameter (GENDER.MALE or GENDER.FEMALE)) inside the request which will be sent to Ajillion
 */
public Builder setGender(Gender gender)
 
/**
 * Set "age" parameter inside the request which will be sent to Ajillion
 */
public Builder setAge(int age)
 
/**
 * Set "pixel context" parameter inside the request which will be sent to Ajillion
 */
public Builder setPixelContext(String pixelContext)
 
/**
 * Set "media type" parameter inside the request which will be sent to Ajillion
 */
public Builder setMediaType(MediaType mediaType)

 

/**
 * Set "count" parameter inside the request which will be sent to Ajillion
 */
public Builder setCount(int count)

 

Document Update: Oct 21, 2015

0 Comments

Please sign in to leave a comment.
Powered by Zendesk