NativeAd

package com.intowow.sdk

public class NativeAd extends Ad

Characteristics

  • 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.

Request an ad

  • You could request an ad by:

  • remember to release ad if it is no longer to use.

Advance Integration

NOTE

  • 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

NativeAd(Context context) Instantiates a new native ad.

Public methods

void

destroy() Release the native ad.

String

getAdBody() Get the ad description. you can call this method after onAdLoaded() of AdListener.

String

getAdCallToAction() Get the ad call to action text. you can call this method after onAdLoaded() of AdListener.

Image

getAdIcon() Get the ad icon. you can call this method after onAdLoaded() of AdListener.

String

getAdTitle() Get the ad title. You can call this method after onAdLoaded() of AdListener.

loadAdInstant(RequestInfo requestInfo) Load ad with requestInfo (synchronous)

void

registerViewForInteraction(View v) Register view for interaction.

void

void

unregisterView() Unregister view.

Inherited methods

int

String

getCampaignId()arrow-up-right Get the campaign id.

String

getEngageUrl()arrow-up-right Get the engage url.

int

getPlace()arrow-up-right Get the ad place.

String

getPlacement()arrow-up-right Get the ad placement.

Rect

getSize()arrow-up-right Get the ad size. It should be called after onAdLoaded().

String

getToken()arrow-up-right Get the ad token for tracking.

long

getTotalFileSize()arrow-up-right Get the ad file size on device.

String

getVideoCoverPath()arrow-up-right Get video cover file path. It should be called after onAdLoaded().

boolean

hasVideoContent()arrow-up-right Check if the ad has video content or not.

boolean

isValid()arrow-up-right Check if the ad is still valid for serving.

Public constructors

NativeAd

NativeAd(Context context, String placement)

Instantiates a new native ad.

Parameters

context

Context: the context.

Public methods

destroy

void destroy()

Release the ad.

downloadAndDisplayImage

void downloadAndDisplayImage()

Download and display image. you can call this method after onAdLoaded() of AdListener.

getAdBody

String getAdBody()

Get the ad description. you can call this method after onAdLoaded() of AdListener.

Returns

String

the ad description.

getAdCallToAction

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.

getAdIcon

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()

getAdTitle

String getAdTitle()

Get the ad title. you can call this method after onAdLoaded() of AdListener.

Returns

String

the ad title.

loadAdInstant

CERequestResult loadAdInstant(RequestInfo requestInfo)

Load ad with RequestInfo (synchronous)

Parameters

requestInfo

RequestInfo: the request info such as placement and timeout.

loadAdAsync

void loadAdAsync(RequestInfo requestInfo, CEAdRequestListener listener)

Load ad with RequestInfo (asynchronous)

Parameters

requestInfo

RequestInfo: the request info such as placement and timeout.

listener

CEAdRequestListener: know the result of loadAdAsync

registerViewForInteraction(View v)

void registerViewForInteraction(View v)

Register view for interaction.

Parameters

v

View: the view for interaction.

registerViewForInteraction(View v, List clickableViews)

void registerViewForInteraction(View v, List clickableViews)

Register view for interaction.

Parameters

v

View: the view for interaction.

clickableViews

List: views for interaction.

setAdListener

void setAdListener(CEAdListener listener)

Set the ad listener.

Parameters

listener

CEAdListener: the ad listener.

setOnTouchListener

void setOnTouchListener(OnTouchListener listener)

Set onTouchListener.

Parameters

listener

OnTouchListener: the onTouchListener.

unregisterView

void unregisterView()

Unregister view.

Last updated