Package com.inmobi.ads
Class InMobiInterstitial
- java.lang.Object
-
- com.inmobi.ads.InMobiInterstitial
-
public final class InMobiInterstitial extends java.lang.Object
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.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
InMobiInterstitial.InterstitialCallbacks
-
Constructor Summary
Constructors Constructor Description InMobiInterstitial(android.content.Context context, long placementId, InterstitialAdEventListener listener)
-
Method Summary
All Methods Instance Methods Concrete Methods Deprecated Methods Modifier and Type Method Description void
disableHardwareAcceleration()
Disable hardware acceleration on the underlying views.org.json.JSONObject
getAdMetaInfo()
Deprecated.java.lang.String
getCreativeId()
Deprecated.PreloadManager
getPreloadManager()
Method to get thePreloadManager
object in order to preload or load a preloaded ad.void
getSignals()
Called to create the request payload & the value is returned inAdEventListener.onRequestPayloadCreated(byte[])
callback on success, and in case of failureAdEventListener.onRequestPayloadCreationFailed(InMobiAdRequestStatus)
is invoked.boolean
isReady()
Returnstrue
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.void
setContentUrl(java.lang.String contentUrl)
Set the current context of the app.void
setExtras(java.util.Map<java.lang.String,java.lang.String> extras)
Set any additional custom parameters that will be sent in the ad request.void
setKeywords(java.lang.String keywords)
Set comma delimited keywords for targeting purposevoid
setListener(InterstitialAdEventListener listener)
Set a listener to be notified of lifecycle events for theInMobiInterstitial
instance.void
show()
Show the interstitial ad.void
show(int enterAnimationResourcedId, int exitAnimationResourceId)
Deprecated.
-
-
-
Constructor Detail
-
InMobiInterstitial
public InMobiInterstitial(android.content.Context context, long placementId, InterstitialAdEventListener listener) throws SdkNotInitializedException
- Parameters:
context
- Represents the context where the interstitial is going to be shownplacementId
- Represents the placement-ID of the interstitial adlistener
- Represents the listener to get callbacks for the lifecycle of the ad- Throws:
SdkNotInitializedException
- If the IM-SDK was not initialized before creating ad object
-
-
Method Detail
-
setListener
public void setListener(InterstitialAdEventListener listener)
Set a listener to be notified of lifecycle events for theInMobiInterstitial
instance.- Parameters:
listener
- Represents the listener to provide callbacks
-
setKeywords
public void setKeywords(java.lang.String keywords)
Set comma delimited keywords for targeting purpose- Parameters:
keywords
- comma delimited keywords for targeting purpose
-
getSignals
public void getSignals()
Called to create the request payload & the value is returned inAdEventListener.onRequestPayloadCreated(byte[])
callback on success, and in case of failureAdEventListener.onRequestPayloadCreationFailed(InMobiAdRequestStatus)
is invoked.
-
getPreloadManager
public PreloadManager getPreloadManager()
Method to get thePreloadManager
object in order to preload or load a preloaded ad.- Returns:
- an instance of
PreloadManager
-
load
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 throughInterstitialAdEventListener
listener.- Parameters:
response
- Represents the response to be used to render an ad
-
load
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 theInterstitialAdEventListener
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.
-
show
public void show()
Show the interstitial ad. Call this method after receiving the callbackInterstitialAdEventListener#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.
-
show
@Deprecated public void show(int enterAnimationResourcedId, int exitAnimationResourceId)
Deprecated.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.
- Parameters:
enterAnimationResourcedId
-exitAnimationResourceId
-
-
isReady
public boolean isReady()
Returnstrue
if the interstitial was loaded successfully and in ready to be shown.- Returns:
true
if the interstitial was loaded successfully and in ready to be shown.
-
getAdMetaInfo
@Deprecated public org.json.JSONObject getAdMetaInfo()
Deprecated.This method has been deprecated, please useAdMetaInfo.getBidInfo()
inInterstitialAdEventListener#onAdFetchSuccessful(InMobiInterstitial, AdMetaInfo)
orInterstitialAdEventListener.onAdDisplayed(InMobiInterstitial, AdMetaInfo)
instead.Returns meta info about Ad if any such info is available otherwise returns empty
JSONObject
- Returns:
- JSONObject
-
getCreativeId
@Deprecated public java.lang.String getCreativeId()
Deprecated.This method has been deprecated, please useAdMetaInfo.getCreativeID()
inInterstitialAdEventListener#onAdFetchSuccessful(InMobiInterstitial, AdMetaInfo)
orInterstitialAdEventListener.onAdDisplayed(InMobiInterstitial, AdMetaInfo)
instead.Returns creativeId if the interstitial was loaded successfully and creativeId is available otherwise returns empty string.
- Returns:
- String
-
setExtras
public void setExtras(java.util.Map<java.lang.String,java.lang.String> extras)
Set any additional custom parameters that will be sent in the ad request.- Parameters:
extras
- Additional custom parameters that will be sent in the ad request.
-
setContentUrl
public void setContentUrl(java.lang.String contentUrl)
Set the current context of the app.- Parameters:
contentUrl
- - Represents the contentUrl of the app
-
disableHardwareAcceleration
public void disableHardwareAcceleration()
Disable hardware acceleration on the underlying views.
-
-