java.lang.Object | ||
↳ | RelativeLayout | |
↳ | com.inmobi.ads.InMobiBanner |
Use this class to integrate banner 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 Classes | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
InMobiBanner.AnimationType | Enumeration for the view transitions during a banner ad refresh. | ||||||||||
InMobiBanner.BannerAdListener | A listener for receiving notifications during the lifecycle of a banner ad. | ||||||||||
InMobiBanner.BannerAdRequestListener | A listener to notify the outcome of a prefetch ad request. |
Public Constructors | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
Construct an
InMobiBanner instance from XML layouts. | |||||||||||
Construct an
InMobiBanner instance. |
Public Methods | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
Turn off hardware acceleration on the underlying views.
| |||||||||||
Returns bid info about Ad if console open bid info available otherwise returns 0
| |||||||||||
Returns meta info about Ad if any such info is available otherwise returns empty
JSONObject | |||||||||||
Returns creativeId if the banner was loaded successfully and creativeId is available
otherwise returns empty string.
| |||||||||||
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. | |||||||||||
Submit a request to load ad content.
| |||||||||||
Called to render the ad with the provided response.
| |||||||||||
Submit a request to load ad content.
| |||||||||||
Pauses any extra processing associated with this
InMobiBanner ad. | |||||||||||
Request for a banner ad.
| |||||||||||
Resumes an
InMobiBanner ad after a previous call to pause() . | |||||||||||
Set the animation preference on the banner views during ad refresh.
| |||||||||||
Set the width and height of Banner.
| |||||||||||
Control if the banner should auto-refresh ad content.
| |||||||||||
Set any additional custom parameters that will be sent in the ad request.
| |||||||||||
Set comma delimited keywords for targeting purpose
| |||||||||||
Set a listener to be notified of lifecycle events for the
InMobiBanner
instance. | |||||||||||
Set a listener to be notified of lifecycle events for the
InMobiBanner instance. | |||||||||||
Specify the refresh interval for the banner ad.
| |||||||||||
Internal use only
|
Protected Methods | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
[Expand]
Inherited Methods | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
![]() |
Construct an InMobiBanner
instance from XML layouts.
context | Represents the context where the banner is going to be shown |
---|---|
attributeSet | Represents the AttributeSet properties of banner in XML |
Construct an InMobiBanner
instance.
context | Represents the context where the banner is going to be shown |
---|---|
placementId | Represents the placement-ID of the banner ad |
Turn off hardware acceleration on the underlying views.
Returns bid info about Ad if console open bid info available otherwise returns 0
Returns meta info about Ad if any such info is available otherwise returns empty JSONObject
Returns creativeId if the banner was loaded successfully and creativeId is available otherwise returns empty string.
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.
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 InMobiBanner.BannerAdListener
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.
Called to render the ad with the provided response. Once the SDK starts loading the provided
response, it will start giving callbacks through BannerAdEventListener
listener.
response | Represents the response to be used to render an ad |
---|
Submit a request to load ad content. Use this method in conjunction with the requestAd(Context, InMobiAdRequest, BannerAdRequestListener)
method to load the prefetched ad when the monetization event is
imminent.
context | the Context where the ad will be rendered. |
---|
Pauses any extra processing associated with this InMobiBanner
ad. Your app must call this method in the
onPause
method of the containing activity or fragment.
You only need to call this method if you
supplied a non-Activity
context while creating your banner ad unit, or if you called the load(Context)
method on the InMobiBanner
instance that was available in the onAdRequestCompleted(InMobiAdRequestStatus, InMobiBanner)
event.
Request for a banner ad. Use this method to prefetch banner ads in your application. This method returns
immediately after submitting a request. You will be notified via the InMobiBanner.BannerAdRequestListener
implementation that you supply in this call when the ad request completes.
Note: This method keeps a
weak reference to the InMobiBanner.BannerAdRequestListener
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
InMobiBanner.BannerAdRequestListener
.
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.
context | any Context implementation |
---|---|
adRequest | an InMobiAdRequest to help customize the ad request |
listener | an InMobiBanner.BannerAdRequestListener implementation that will be called when the ad request
completes.
|
Resumes an InMobiBanner
ad after a previous call to pause()
. Your app must call this method in
the onResume
method of the containing activity or fragment.
You only need to call this method if you
supplied a non-Activity
context while creating your banner ad unit, or if you called the load(Context)
method on the InMobiBanner
instance that was available in the onAdRequestCompleted(InMobiAdRequestStatus, InMobiBanner)
event.
Set the animation preference on the banner views during ad refresh.
Set the width and height of Banner. These values should be same as layout dimensions.
widthInDp | width of Banner in DP |
---|---|
heightInDp | height of Banner in DP |
Control if the banner should auto-refresh ad content.
enabled | true if banner should auto-refresh, otherwise false
|
---|
Set any additional custom parameters that will be sent in the ad request.
extras | Represents the extras |
---|
Set comma delimited keywords for targeting purpose
keywords | Represents the keywords |
---|
Set a listener to be notified of lifecycle events for the InMobiBanner
instance. Use setListener(BannerAdEventListener)
instead.
listener | Represents the listener to provide callbacks |
---|
Set a listener to be notified of lifecycle events for the InMobiBanner
instance.
listener | Represents the listener to provide callbacks |
---|
Specify the refresh interval for the banner ad.
refreshInterval | Represents the interval at which the banner ad will refresh |
---|
Internal use only