Banner ads are added as a view inside your application. Consumers of your app can tap the banner ad to interact with it.

Multiple banners views may be added to the UI at any time, callbacks occur independently for each view.

As of v5.7.0 will handle the refresh interval itself. Please make sure that the refresh interval in the ad network dashboard is disabled, otherwise you may experience unexpected behaviour

1. Create the view

To begin preparations for displaying a banner ad, you need to create a view. You can insert the ad straight into your XML layout files, OR create it dynamically in Java.

You can insert the ad straight into your XML layout files OR create it dynamically in Java.

After creating the view you'll then need to load the ad using Java code.

A. Create view in XML

Insert the TMBannerAdView into your layout, like so:


Once this is done, navigate to your Activity or Fragment. Find the ad view that has been inserted into the xml layout, like so:

TMBannerAdView ad = (TMBannerAdView) findViewById(;

B. Create view in Java

If you have created a view in XML to load the banner, you can skip this step.

To create an ad view, implement the following code:

TMBannerAdView ad = new TMBannerAdView(this); // Create ad view

yourLayout.addView(ad); // Insert view into layout

The view will be added to your layout.

2. Override TMAdListener

Next, you will need to override the TMAdListener class to receive callbacks on interstitial adverts. Create a new file and implement it like so:

public class BannerListener extends TMAdListener {
    public void didLoad() {
        // First banner loaded into view
    public void didFailToLoad(TMAdError error) {
        // No banners available. View will stop refreshing
    public void didRefresh() {
        // Subequent banner loaded, this view will refresh every 30 seconds
    public void didFailToRefresh(TMAdError error) {
        // Banner could not load, this view will attempt another refresh every 30 seconds
    public void didClick() {
        // User clicked on banner

3. Load the banner

The banner needs to be loaded using different parameters: Placement Tag, Size or custom size. You can see a full list of TMBannerAdSizes here.

Call the load method and set the parameters to what you require, like so:

ad.load(this, TMBannerAdSizes.STANDARD, new TMAdListener()); // Load banner with predefined size using default placement
ad.load this, "<INSERT_PLACEMENT_TAG>", TMBannerAdSizes.STANDARD, new TMAdListener()); // Load banner with predefined size using specified placement
ad.load(this, "<INSERT_PLACEMENT_TAG>", new TMAdListener()); // Load banner with custom size using specified placement

Not all banner sizes are available for all networks, if an ad size is unavailable for the registered Adapters, a log will be printed and no ad will be shown.

You can also override TMAdListener and implement our listener methods to have greater control over banners. For more information, see our Callbacks page.

4. Destroy the banner

You must destroy the ad view which ensures it is removed from the layout and cleared from memory.

To destory the banner, implement the following within your Activity or Fragment onDestroy() lifecycle event:

protected void onDestroy() {
    TMBannerAdView ad = (TMBannerAdView) findViewById(;
    if (ad != null) {

Build and run your application to test the advert displays correctly.

5. Banner Sizes

Predefined sizes

Banner Size AdColony AppLovin Facebook Audience Network Google Ad Mob InMobi UnityAds
STANDARD 320x50 320x50 320x50 320x50 320x50 320x50
LARGE N/A N/A 320x90 320x100 N/A N/A
MEDIUM_RECT 300x250 N/A 300x250 300x250 300x250 N/A
FULL N/A N/A N/A 468x60 N/A 468x60
LEADERBOARD 728x90 728x90 N/A 728x90 N/A 728x90
SMART N/A N/A Various x 50 Various x 50 N/A N/A
CUSTOM Various x Various Various x Various Various x Various Various x Various Various x Various Various x Various

Custom Size

This is an automated selection where any banner will be shown in the view if it can fit. E.g. a view with size 400x60 will display either a Standard or Smart banner, depending on which network is selected. The size used is the size of the TMBannerAdView object.

Custom size banners requires v7.5.0 or higher

Need help?

If you are having any problems integrating, feel free to contact us on [email protected] and we will be more than happy to help.

What's next?

Now that you have successfully integrated a banner into your app, what would you like to do next?