NativeAd
Last updated
Last updated
package com.intowow.sdk
public class NativeAd extends Ad
Support image and video.
Video is mute by default, and can be toggled by clicking it.
Creative, title and description of ad are accessible to app for customized layout.
Custom
You could request an ad by:
remember to release ad if it is no longer to use.
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
void
String
String
Image
String
void
Load ad with requestInfo (asynchronous)
void
void
void
void
void
Inherited methods
int
String
String
int
String
Rect
String
long
String
boolean
boolean
void
NativeAd(Context context, String placement)
Instantiates a new native ad.
Parameters
context
Context: the context.
void destroy()
Release the ad.
void downloadAndDisplayImage()
Download and display image. you can call this method after onAdLoaded() of AdListener.
String getAdBody()
Get the ad description. you can call this method after onAdLoaded() of AdListener.
Returns
String
the ad description.
String getAdCallToAction()
Get the ad call to action text. you can call this method after onAdLoaded() of AdListener.
Returns
String
the ad call to action text.
Image getAdIcon()
Get the ad icon. you can call this method after onAdLoaded() of AdListener.
Returns
Image
the ad icon. you can get icon url to download the icon file by calling image.getUrl()
, and get icon size by calling image.getWidth()
and image.getHeight()
String getAdTitle()
Get the ad title. you can call this method after onAdLoaded() of AdListener.
Returns
String
the ad title.
Load ad with RequestInfo (synchronous)
Parameters
requestInfo
Load ad with RequestInfo (asynchronous)
Parameters
requestInfo
listener
void registerViewForInteraction(View v)
Register view for interaction.
Parameters
v
View: the view for interaction.
void registerViewForInteraction(View v, List clickableViews)
Register view for interaction.
Parameters
v
View: the view for interaction.
clickableViews
List: views for interaction.
Set the ad listener.
Parameters
listener
void setOnTouchListener(OnTouchListener listener)
Set onTouchListener.
Parameters
listener
OnTouchListener: the onTouchListener.
void unregisterView()
Unregister view.
After ad loading, you can configure your ad by using AdProperty
with class.
You could use to check if the ad is video or not after ad loaded.
Instantiates a new native ad.
Release the native ad.
Download and set image to imageView.
Get the ad description. you can call this method after onAdLoaded() of AdListener.
Get the ad call to action text. you can call this method after onAdLoaded() of AdListener.
Get the ad icon. you can call this method after onAdLoaded() of AdListener.
Get the ad title. You can call this method after onAdLoaded() of AdListener.
Load ad with requestInfo (synchronous)
Register view for interaction.
Register view for interaction.
Set the ad listener.
Set onTouchListener.
Unregister view.
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
void setAdListener( listener)
: the ad listener.