Ad
Last updated
Last updated
package com.intowow.sdk
public abstract class Ad
This class is the parent class of , and .
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
String
String
int
String
Rect
String
long
String
boolean
boolean
void
int getAdId()
Get the ad id.
Returns
int
the ad id.
String getCampaignId()
Get the campaign id.
Returns
String
the campaign id. This value may be null.
String getEngageUrl()
Get the engage url.
Returns
String
the engage url. This value may be null.
int getPlace()
Get the ad place.
Returns
int
the ad place.
String getPlacement()
Get the ad placement.
Returns
String
the ad placement.
Rect getSize()
Get the ad size. You should call this method after ad loaded.
Returns
Rect
the ad size. This value may be null.
String getToken()
Get the ad token for tracking.
Returns
String
the ad token. This value may be null.
long getTotalFileSize()
Get the ad file size on device.
Returns
long
the ad token.
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.
boolean hasVideoContent()
Check if the ad has video content or not.
Returns
boolean
true the ad has video content otherwise return false.
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.
void setWidth(int width)
Set the ad width. You should call this method before loadAd() if necessary.
Parameters
width
int: the ad width.
Get the ad id.
Get the campaign id.
Get the engage url.
Get the ad place.
Get the ad placement.
Get the ad size. You should call this method after ad loaded.
Get the ad token for tracking.
Get the ad file size on device.
Get video cover file path. It should be called after onAdLoaded().
Check if the ad has video content or not.
Check if the ad is still valid for serving.
Set the ad size.