|
Triton Mobile SDK for Android
|
The View to display banner ads. More...
Classes | |
| interface | BannerListener |
| A listener for receiving BannerView notifications. More... | |
Public Member Functions | |
| BannerView (Context context) | |
| Constructor. | |
| BannerView (Context context, AttributeSet attrs) | |
| Constructor. | |
| BannerView (Context context, AttributeSet attrs, int defStyle) | |
| Constructor. | |
| void | clearBanner () |
| Clears the current ad but keep the View in order to reuse it later. More... | |
| int | getBannerFallbackHeight () |
| Returns the banner's fallback height in density-independent pixels. | |
| int | getBannerFallbackWidth () |
| Returns the banner's fallback width in density-independent pixels. | |
| int | getBannerHeight () |
| Returns the banner's height in density-independent pixels. | |
| int | getBannerWidth () |
| Returns the banner's width in density-independent pixels. | |
| Point | getBestBannerSize (Bundle ad, int containerWidth, int containerHeight) |
| Find the best banner size from an ad bundle which fits a layout container. More... | |
| BannerListener | getListener () |
| Returns the banner listener. | |
| boolean | isBannerLoaded () |
| Returns true if the an ad is loaded. | |
| void | onPause () |
| Pauses any extra processing associated with this BannerView. More... | |
| void | onResume () |
| Resumes an BannerView after a previous call to pause(). More... | |
| void | release () |
| Destroys the internal state of this BannerView. More... | |
| void | setBannerSize (int width, int height) |
| void | setBannerSize (int width, int height, int fallbackWidth, int fallbackHeight) |
| Sets the ad size in density-independent pixels. More... | |
| void | setListener (BannerListener listener) |
| Sets the banner listener. | |
| void | showAd (Bundle ad) |
| Show an ad. More... | |
Static Public Member Functions | |
| static String | debugErrorToStr (int errorCode) |
| Converts the error codes to a string. More... | |
Static Public Attributes | |
| static final int | ERROR_BANNER_SIZE_NOT_SET = 8012 |
| setBannerSize(int, int) must be called before loading an ad | |
| static final int | ERROR_LOAD_AFTER_RELEASE = 8006 |
| Trying to load an ad after release() | |
| static final int | ERROR_NETWORK_NOT_AVAILABLE = AdLoader.ERROR_NETWORK_NOT_AVAILABLE |
| Network not available. | |
| static final int | ERROR_NO_BANNER_RIGHT_SIZE = 8011 |
| The loaded ad doesn't have a banner of the right size. | |
| static final int | ERROR_NO_BANNERS = 8010 |
| The loaded ad doesn't have any banner. | |
| static final int | ERROR_NO_INVENTORY = AdLoader.ERROR_NO_INVENTORY |
| No ad available. | |
| static final int | ERROR_TIMEOUT = 8013 |
| The maximum time has been reached. | |
| static final int | ERROR_UNKNOWN = AdLoader.ERROR_UNKNOWN |
| Unspecified error. | |
| static final int | ERROR_UNKNOWN_HOST = AdLoader.ERROR_UNKNOWN_HOST |
| Unknown host. | |
The View to display banner ads.
The size must be set prior to calling showAd(Bundle).
| void com.tritondigital.ads.BannerView.clearBanner | ( | ) |
Clears the current ad but keep the View in order to reuse it later.
This method is usually called at the end of an audio ad with a sync banner.
|
static |
Converts the error codes to a string.
| Point com.tritondigital.ads.BannerView.getBestBannerSize | ( | Bundle | ad, |
| int | containerWidth, | ||
| int | containerHeight | ||
| ) |
Find the best banner size from an ad bundle which fits a layout container.
It returns null if no size fits the container
| ad | The Ad bundle with the banners to search for |
| containerWidth | The container width in dp |
| containerHeight | The container height in dp |
| void com.tritondigital.ads.BannerView.onPause | ( | ) |
Pauses any extra processing associated with this BannerView.
This method should be called in the parent Activity.onPause() method.
| void com.tritondigital.ads.BannerView.onResume | ( | ) |
Resumes an BannerView after a previous call to pause().
This method should be called in the parent Activity.onResume() method.
| void com.tritondigital.ads.BannerView.release | ( | ) |
Destroys the internal state of this BannerView.
This method should be called after this BannerView has been removed from the view system. No other methods should be called this.
| void com.tritondigital.ads.BannerView.setBannerSize | ( | int | width, |
| int | height | ||
| ) |
| void com.tritondigital.ads.BannerView.setBannerSize | ( | int | width, |
| int | height, | ||
| int | fallbackWidth, | ||
| int | fallbackHeight | ||
| ) |
Sets the ad size in density-independent pixels.
The size change will be effective only on the next ad display. The fallback values will be used if no banner is found with the main size.
| void com.tritondigital.ads.BannerView.showAd | ( | Bundle | ad | ) |
Show an ad.
This view takes care of taking the right banner from the ad bundle.
| ad | The ad to load. |