Integration‎ > ‎

Preroll sdk Android

Vdopia's new Android Preroll SDK allows app developers to serve preroll video ads into apps using just a few lines of code.

Creating an preroll enabled Android app involves the following steps:

  • Obtain the SDK from iVdopia.
  • Integrate the SDK with your Application.
  • Obtain an API key for your application and configure ads using iVdopia's publisher portal.
  • Test ad delivery to your application using an Android device.
  • Distribute your application on the Android marketplace.
  • Monitor your application's performance and earnings using iVdopia's publisher portal.

SDK components

The SDK bundle which can be downloaded from http://wiki.ivdopia.com/file-cabinet  includes the following files that need to be included into apps:

vdopia_sdk_preroll.1.0.1.jar


Integration Steps

Set up the project

  • Add vdopia_sdk_preroll.1.0.0.jar to your build path.
  • Modify your projects AndroidManifest.xml file to include iVdopia elements.
  • Include a description of the Activity that will display preroll ads.    
    <activity android:name="com.vdopia.android.preroll.VDOPrerollActivity"
    android:theme="@android:style/Theme.Translucent.NoTitleBar.Fullscreen"
    android:screenOrientation="landscape"
    android:configChanges="orientation|keyboardHidden"> 
    </activity>

add following permissions in your manifest:

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

SDK Initialization

Make the following call for sdk initialization with your APiKey.Replace AX123 with your apikey.Intialize the sdk and set the listener on the time of app load.

VDO.initialize("AX123", YOUR_ACTIVITY_CONTEXT);

Setting callback listener

VDO.setListener(VDOPIA_CALLBACK_LISTENER_LISTENER);

Requesting Preoll Ads

You can request the ads on any activity that you create.

VDO.requestPreroll(APPLICATION CONTEXT, 5);

Ad Event notifications and listeners

During the process of serving the ads, the SDK informs the application about various events that ensures that the application can respond appropriately. Vdopia's preroll SDK gives out these events in the form of callbacks that can be received by implememting functions of VDO.AdEventListener interface.

Following is the interface definition:

public static interface PrerollAdEventListener {

public void noPreroll(int retCode);

public void startPreroll();

public void endPreroll();

}

For example you can create a class VdopiaEventListener which implements this interface:

Public VdopiaEventListener implements VDO.PrerollAdEventListener {

//Implements all three callbacks

}

retCode variable in noPreroll can be one of the following three.

VDO.ERROR_INVALID_APIKEY=209;

VDO.ERROR_NO_AD_FOUND=203;

VDO.ERROR_UNKNOWN=201;


Requesting Live Ads

Once you complete the testing for the first time, and submit the application to android. Write to support@ivdopia.com. To change your application status to "Live Mode". Please note that once live mode is enabled you will no longer see test ads on your application.

If you need to test your application with test ads again you will need to create another API key for testing purposes.

Moving to a new Vdopia SDK

Whenever there is a iVdopia Android SDK update, please go through the RELEASE notes to see if there is any API update. In case of an API update, you may have to implement a few more functions in the listener class. However, if there is no API update, a simple update of the .jar file in your build path should suffice.

In either case, since your original APP key is running Live Ads we recommend you test with a separate APP Key that you use for test mode.

Comments