Ad

package com.intowow.sdk

public abstract class Ad

  • This class is the parent class of InterstitialAd, DisplayAd and NativeAd.

  • You can get more information such as adId, engage url or total file size etc. from Ad after AdListener.onAdLoaded(Ad ad) is called.

  • If you want to get ad size, please call getSize() after calling AdListener.onAdLoaded(Ad ad), but for NativeAd, you only can get media view size after calling MediaView.setNativeAd(NativeAd ad).

Public methods

int

getAdId() Get the ad id.

String

getCampaignId() Get the campaign id.

String

getEngageUrl() Get the engage url.

int

getPlace() Get the ad place.

String

getPlacement() Get the ad placement.

Rect

getSize() Get the ad size. You should call this method after ad loaded.

String

getToken() Get the ad token for tracking.

long

getTotalFileSize() Get the ad file size on device.

String

getVideoCoverPath() Get video cover file path. It should be called after onAdLoaded().

boolean

hasVideoContent() Check if the ad has video content or not.

boolean

isValid() Check if the ad is still valid for serving.

void

setSize(Rect rect) Set the ad size.

Public methods

getAdId

int getAdId()

Get the ad id.

Returns

int

the ad id.

getCampaignId

String getCampaignId()

Get the campaign id.

Returns

String

the campaign id. This value may be null.

getEngageUrl

String getEngageUrl()

Get the engage url.

Returns

String

the engage url. This value may be null.

getPlace

int getPlace()

Get the ad place.

Returns

int

the ad place.

getPlacement

String getPlacement()

Get the ad placement.

Returns

String

the ad placement.

getSize

Rect getSize()

Get the ad size. You should call this method after ad loaded.

Returns

Rect

the ad size. This value may be null.

getToken

String getToken()

Get the ad token for tracking.

Returns

String

the ad token. This value may be null.

getTotalFileSize

long getTotalFileSize()

Get the ad file size on device.

Returns

long

the ad token.

getVideoCoverPath

String getVideoCoverPath()

Get video cover file path on device. It should be called after onAdLoaded().

Returns

String

the video cover file path on device. This value may be null.

hasVideoContent

boolean hasVideoContent()

Check if the ad has video content or not.

Returns

boolean

true the ad has video content otherwise return false.

isValid

boolean isValid()

Check if the ad is still valid for serving.

All of ads from intowow has the expired time (most for 1 hour). If you cache the ad by yourself, be sure to call this method to check the ad is valid before showing the ad. Otherwise, the impression won't be counted due to the ad creative has expired.

Returns

boolean

true the ad is still valid for serving otherwise return false.

setSize

void setWidth(int width)

Set the ad width. You should call this method before loadAd() if necessary.

Parameters

width

int: the ad width.

Last updated