Understanding the Mobile Ads API

What is the Amazon Mobile Ads API?

The Amazon Mobile Ads API allows you to easily place high-quality display ads from the Amazon Mobile Ad Network in your app. The Amazon Mobile Ad Network can help you better monetize your apps and gain exclusive access to highly relevant ads from brand advertisers, including Amazon and its subsidiaries.

How Do I Get Started?

Important: This guide assumes that you are an Android developer.

You can quickly add a new ad placement to an existing app by following the steps in the Quick Start Guide. To maximize your eCPM, please ensure that you provide Amazon Mobile Ad Network the first look and then fall back to other ad networks when ads are not available; you can see an example of how this can be done on the Using Amazon Mobile Ads API with Other SDKs page. Next, you'll want to verify that the ad placement is working correctly by following the Developer Launch Checklist. Lastly, you'll want to submit your app on the Amazon Mobile App Distribution Portal or Google Play.

Available Tools, Libraries, and Interfaces

The Amazon Mobile Ad Network provides a Java API for Android 1.6 and newer phones and tablets.

Amazon Mobile Ad Network Concepts

Auto Ad Size

The Amazon Mobile Ads API can be set to automatically choose an optimally sized ad and scale it to fit your ad view. The size chosen is based on the screen dimensions and pixel density of the device loading the ad as well as the dimensions of the view itself.

To enable Auto Ad Size, simply leave out the AdSize parameter when defining your AdLayout in either Java or XML. Here is an example of how you would set the AdLayout within Java code:

    this.adView = new AdLayout(this);

Here is an example of how you would set the AdLayout within an XML layout file:


Learn more about creating AdLayouts in the Quick Start Guide.

Auto Ad Size Guidelines

  • Auto Ad Size is designed for screen-wide banner ads. We recommend setting your AdLayout’s width to MATCH_PARENT and placing it within a layout whose width equals the screen’s width.
  • We recommend setting the AdLayout’s height to WRAP_CONTENT to ensure that the ad will scale to fill the entire AdLayout. Alternatively, you can limit the ad’s height by setting it to a device-independent pixel value instead.
  • On tablet-sized devices, including 7” tablets such as the Kindle Fire as well as larger tablets, banner ads of sizes 600x90, 728x90, or 1024x50 will be selected. On smaller devices, including most phones, banner ads of sizes 300x50 or 320x50 will be selected. If the chosen ad is smaller than its AdLayout then it will be upscaled to span one of the dimensions.
  • On phone-sized devices, your AdLayout must be at least 300dp wide and 50dp high.
  • On tablet-sized devices, your AdLayout must be at least 533dp wide and 79dp high, or at least 1024dp wide and 50dp high.

Important: If your AdLayout is too small then no ad will be returned and ad loading will fail. You can ensure that your AdLayout is large enough for most scenarios by creating a screen-wide AdLayout with its width set to MATCH_PARENT and its height to WRAP_CONTENT.

Manual Ad Size

If you want to set the ad size yourself, you can specify a size in either the AdLayout constructor or through XML. Manually setting the size is recommended for ads that do not span the entire screen width and it's required for 300x250 ads. The Amazon Mobile Ad Network supports ad sizes of 300x50, 320x50, and 300x250 for phones and 600x90, 728x90, 1024x50, and 300x250 for tablets. Your app should request a device-appropriate size, which will be scaled to your ad view.

Ad sizes are specified in the AdLayout constructor or the XML layout file. Here is an example of how you would set the AdLayout within Java code:

    this.adView = new AdLayout(this, AdSize.SIZE_320x50);

For setting the size through the Java code as in the above example, you must provide the AdLayout constructor with one of the following AdSize class fields:

  • AdSize.SIZE_300x50
  • AdSize.SIZE_320x50
  • AdSize.SIZE_300x250
  • AdSize.SIZE_600x90
  • AdSize.SIZE_728x90
  • AdSize.SIZE_1024x50

Alternatively, you can also specify the size within an XML AdLayout initialization as follows:


Please see the following chart for recommended sizes by device:

Ad Size Android Phone Android Tablet Kindle Fire
300x50 Yes No No
320x50 Yes No No
300x250 Yes Yes Yes
600x90 No Yes Yes
728x90 No Yes No
1024x50 No Yes Yes

Ad Types

The Amazon Mobile Ad Network supports two ad types: static clickthrough banners and rich media expandable banners. Interstitial ads are not directly supported, but could be built by wrapping our 300x250-sized banners inside a layout or view.

Static Banners - HTML web views that typically open an in-app browser, native browser, or Android Intent.

Rich Media Expandable Banners - HTML web views that expand in-app with rich interactive content, which includes playing of videos. The call to action in these ads typically includes opening an in-app browser, native browser, or Android Intent.

Above the Fold

All ad placements must be above the fold, which means fully visible without scrolling. If an ad placement is embedded with content in a screen, it can scroll with that content and scroll off of the screen as long as it started above the fold.

Ad Reload Rate

The Amazon Mobile Ad Network recommends loading a new ad on screen navigations and device orientation changes when the ad view changes size. You may also want to refresh the ad after a set time interval. In this case, the Amazon Mobile Ad Network recommends a refresh rate of 30 to 60 seconds. Faster ad refresh intervals could result in blocked ad requests. Please note that the Amazon Mobile Ads API does not provide any built-in functionality for automatically refreshing ads.

Return to the Amazon Mobile Ads API Overview

Unavailable During Maintenance