public final class

InMobiInterstitial

extends Object
java.lang.Object
   ↳ com.inmobi.ads.InMobiInterstitial

Class Overview

Use this class to integrate full screen, interstitial ads in your application.

Note This class is not thread-safe. All methods on instances of this class must be called on the UI thread.

Summary

Nested Classes
interface InMobiInterstitial.InterstitialAdListener2 Listener for receiving notifications during the lifecycle of an interstitial. 
interface InMobiInterstitial.InterstitialAdRequestListener A listener to notify the outcome of a prefetch ad request. 
Public Constructors
InMobiInterstitial(Context context, long placementId, InMobiInterstitial.InterstitialAdListener2 listener)
InMobiInterstitial(Context context, long placementId, InterstitialAdEventListener listener)
Public Methods
void disableHardwareAcceleration()
Disable hardware acceleration on the underlying views.
JSONObject getAdMetaInfo()
Returns meta info about Ad if any such info is available otherwise returns empty JSONObject
String getCreativeId()
Returns creativeId if the interstitial was loaded successfully and creativeId is available otherwise returns empty string.
void getSignals()
Called to create the request payload & the value is returned in onRequestPayloadCreated(byte[]) callback on success, and in case of failure onRequestPayloadCreationFailed(InMobiAdRequestStatus) is invoked.
boolean isReady()
Returns true if the interstitial was loaded successfully and in ready to be shown.
void load()
Submit a request to load ad content.
void load(byte[] response)
Called to render the ad with the provided response.
static void requestAd(Context context, InMobiAdRequest adRequest, InMobiInterstitial.InterstitialAdRequestListener interstitialAdRequestListener)
Request for an interstitial ad.
void setExtras(Map<String, String> extras)
Set any additional custom parameters that will be sent in the ad request.
void setInterstitialAdListener(InMobiInterstitial.InterstitialAdListener2 listener)
Set a listener to be notified of lifecycle events for the InMobiInterstitial instance.
void setKeywords(String keywords)
Set comma delimited keywords for targeting purpose
void setListener(InterstitialAdEventListener listener)
Set a listener to be notified of lifecycle events for the InMobiInterstitial instance.
void show(int enterAnimationResourcedId, int exitAnimationResourceId)
Show the interstitial ad.
void show()
Show the interstitial ad.
[Expand]
Inherited Methods
From class java.lang.Object

Public Constructors

public InMobiInterstitial (Context context, long placementId, InMobiInterstitial.InterstitialAdListener2 listener)

public InMobiInterstitial (Context context, long placementId, InterstitialAdEventListener listener)

Public Methods

public void disableHardwareAcceleration ()

Disable hardware acceleration on the underlying views.

public JSONObject getAdMetaInfo ()

Returns meta info about Ad if any such info is available otherwise returns empty JSONObject

Returns
  • JSONObject

public String getCreativeId ()

Returns creativeId if the interstitial was loaded successfully and creativeId is available otherwise returns empty string.

Returns
  • String

public void getSignals ()

Called to create the request payload & the value is returned in onRequestPayloadCreated(byte[]) callback on success, and in case of failure onRequestPayloadCreationFailed(InMobiAdRequestStatus) is invoked.

public boolean isReady ()

Returns true if the interstitial was loaded successfully and in ready to be shown.

public void load ()

Submit a request to load ad content. This method returns immediately upon enqueuing a request. Your application shall be notified of the result on the InMobiInterstitial.InterstitialAdListener2 callback.

Note This method must be called on the UI thread. Failure to do so will affect your ability to monetize with the InMobi Ad SDK.

public void load (byte[] response)

Called to render the ad with the provided response. Once the SDK starts loading the provided response, it will start giving callbacks through InterstitialAdEventListener listener.

Parameters
response Represents the response to be used to render an ad

public static void requestAd (Context context, InMobiAdRequest adRequest, InMobiInterstitial.InterstitialAdRequestListener interstitialAdRequestListener)

Request for an interstitial ad. Use this method to prefetch interstitial ads in your application. This method returns immediately after submitting a request. You will be notified via the InMobiInterstitial.InterstitialAdRequestListener implementation that you supply in this call when the ad request completes.

Note: This method keeps a weak reference to the InMobiInterstitial.InterstitialAdRequestListener instance and will be garbage collected if you do not keep a strong reference to it. To receive callbacks when an request is completed caller should keep strong reference of InMobiInterstitial.InterstitialAdRequestListener.

Note This method must be called on the UI thread. Failure to do so will affect your ability to monetize with the InMobi Ad SDK.

Parameters
context any Context implementation
adRequest an InMobiAdRequest to help customize the ad request
interstitialAdRequestListener an InMobiInterstitial.InterstitialAdRequestListener implementation that will be called when the ad request completes.

public void setExtras (Map<String, String> extras)

Set any additional custom parameters that will be sent in the ad request.

public void setInterstitialAdListener (InMobiInterstitial.InterstitialAdListener2 listener)

Set a listener to be notified of lifecycle events for the InMobiInterstitial instance. Use setListener(InterstitialAdEventListener) instead.

Note This method will no longer be supported from the next major version

Parameters
listener Represents the listener to provide callbacks

public void setKeywords (String keywords)

Set comma delimited keywords for targeting purpose

public void setListener (InterstitialAdEventListener listener)

Set a listener to be notified of lifecycle events for the InMobiInterstitial instance.

Parameters
listener Represents the listener to provide callbacks

public void show (int enterAnimationResourcedId, int exitAnimationResourceId)

Show the interstitial ad. This method allows your application to set the transition animation when the ad is shown to the user. If an invalid value of enter or exit animation id is provided the default animations of the platform will be used. In order to disable enter/exit animations please pass 0 as the animation id.

Note This method must be called on the UI thread. Failure to do so will affect your ability to monetize with the InMobi Ad SDK.

public void show ()

Show the interstitial ad. Call this method after receiving the callback onAdLoadSucceeded(InMobiInterstitial)

Note This method must be called on the UI thread. Failure to do so will affect your ability to monetize with the InMobi Ad SDK.