Native Inview Ads – Android 2.4
Our innovative Native InView Ad unit instantly transforms any content wall within an app into premium video inventory. Natively…
Mediation Partners…
How to Enable Native InView Ad Unit
Note: You will see reference to InView In-Line and InView Push-Down throughout this guide documentation.
InView Push-Down can…
Import Libraries.
Copy to Clipboard
import com.vdopia.ads.lw.LVDOAdRequest;
import com.vdopia.ads.lw.LVDOAdSize;
import com.vdopia.ads.lw.LVDOBannerAd;
import com.vdopia.ads.lw.LVDOBannerAdListener;
import com.vdopia.ads.lw.LVDOConstants;
To add InView In-Line Ad in your application, first, you…
In Adapter class code, declare instance variables as shown below
private int mAdPosition;
private boolean mAdLoaded;
private final String mApiKey;
private LVDOBannerAd mAdView;
private final…
Create LVDOAdView instance
Copy to Clipboard
mAdView = new LVDOBannerAd(mActivity, mAdSize, mApiKey, this);
Where,
mActivity = context
mAdSize = INVIEW_LEADERBOARD (for InView In-Line) or IAB_MRECT…
Create LVDOAdRequest instance. Configure ad request parameters & targeting parameters for that instance.
Copy to Clipboard
LVDOAdRequest adRequest = new LVDOAdRequest(mActivity);
LocationData locationData = new…
Copy to Clipboard
mAdView.loadAd(adRequest);
Use onBannerAdLoaded() callback method to check Ad is loaded and once Ad is loaded, add the Ad in to your Listview.…
Code Snippets
Layout for List item
<?xml version=”1.0″ encoding=”utf-8″?>
Copy to Clipboard
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:background="#ffffff"
android:orientation="vertical">
<!-- Here the Actual list item is…
ListView Adapter to load the Ad in ListView
Copy to Clipboard
public class InviewVideoAdapter extends BaseAdapter {
private static final String TAG = "InviewVideoAdapter";
private…
Event Listeners
You may track ad lifecycle events like request failures or click-through. This interface may be implemented by your activity or any other object.…