DispayAd
Last updated
Last updated
package com.intowow.sdk
public class DisplayAd extends Ad
Support image and video.
Video is mute by default, and can be toggled by clicking it.
Custom
You could request an ad by:
remember to release ad if it is no longer to use.
You could use AdProperty
to configure your ad if necessary:
AdProperty.VIDEO_AUTO_REPEAT
: if video auto repeat or not, the default value is true.
AdProperty.HIDE_AD_ICON
: if need to hide the ad icon, the default value is false.
AdProperty.SILENT_START
: auto silent play, the default value is true.
Please make sure to new an instance before requesting the ad. Do not keep the returned ad too long, otherwise you may display the out-of-dated ad.
Public constructors
Public methods
void
View
View
boolean
boolean
void
Load ad with requestInfo (asynchronous)
void
void
boolean
boolean
void
void
void
void
void
void
void
Inherited methods
int
String
String
int
String
Rect
String
long
String
boolean
boolean
void
DisplayAd(Context context)
Instantiates a new display ad.
Parameters
context
Context: the context.
DisplayAd(Context context, String placement, Map<String, Object> adProps)
Instantiates a new display ad.
Parameters
context
Context: the context.
adProps
Map<String, Object>: the ad property.
void destroy()
Release the ad.
View getView()
Gets the ad view. You should call this method after onAdloaded().
Returns
View
the ad view.
View getView(Activity activity)
Gets the ad view. You should call this method after onAdloaded().
Parameters
activity
Activity: For Moat SDK tracking purpose. If you initiate the display ad without using activity and need to use Moat SDK, please use this API to initiate Moat SDK correctly.
Returns
View
the ad view.
boolean isAvailableAttachToWindow()
Checks if this ad is available to attach to window or not.
Returns
boolean
true the ad is available to attach the window otherwise return false.
boolean isMute()
Checks if this ad is on mute status or not.
Returns
boolean
true if this ad is on mute status otherwise return false.
Load ad with RequestInfo (synchronous)
Parameters
requestInfo
Load ad with RequestInfo (asynchronous)
Parameters
requestInfo
listener
void mute()
Mute video ad.
void play()
Allow the ad to play.
boolean resize(int width)
Resize the ad.
Parameters
width
int: the ad width.
Returns
boolean
true resize the ad successfully otherwise return false.
Resize the ad by CEAdSize.
Parameters
ceAdSize
Returns
boolean
true resize the ad successfully otherwise return false.
Set the ad listener.
Parameters
listener
void setIsVideoAutoRepeat(boolean isVideoAutoRepeat)
Set if the video ad should auto repeat or not. You should call this method before loadAd if necessary.
Parameters
isVideoAutoRepeat
boolean: true the video ad should auto repeat otherwise false.
void setPlace(int place)
Set the ad place.
Parameters
place
int: the ad place.
void stop()
Disallow the ad to play.
void unmute()
Unmute video ad.
Set the ad view size by ad ratio. You should call this method before loadAd if necessary.
Parameters
ceAdSize
You could use to instruct SDK to set an expected width of the ad, and SDK will rescale the ad automatically and keeps the aspect ratio.
You could use to check if the ad is video or not after ad loaded.
If you want to resize the ad, please use .
Instantiates a new display ad.
Instantiates a new display ad.
Release the display ad.
Get the ad view. You should call this method after ad loaded.
Get the ad view. You should call this method after ad loaded.
Checks if this ad is available to attach to window or not.
Checks if this ad is on mute status or not.
Load ad with requestInfo (synchronous)
Mute video ad.
Allow the ad to play.
Resize the ad.
Resize the ad by CEAdSize.
Set the ad listener.
set if the video ad should auto repeat or not. You should call this method before loadAdInstant/loadAdAsync if necessary.
Set the ad place.
Set the ad width. You should call this method before loadAdInstant/loadAdAsync if necessary.
Disallow the ad to play.
Unmute video ad.
Set the ad view size by ad ratio. You should call this method before loadAdInstant/loadAdAsync if necessary.
Get the ad id.
Get the campaign id.
Get the engage url.
Get the ad place.
Get the ad placement.
Get the ad size. It should be called after onAdLoaded().
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.
loadAdInstant(RequestInfo requestInfo)
: the request info such as placement and timeout.
void loadAdAsync(RequestInfo requestInfo, listener)
: the request info such as placement and timeout.
: know the result of loadAdAsync
boolean resize( ceAdSize)
: the CEAdSize.
void setAdListener( listener)
: the ad listener.
void setAdSize( ceAdSize)
: the CEAdSize