The following updates have been made to the Mobile Ads Android SDK.
- Version 5.9.0 (July 10, 2018)
- Version 5.7 (Updated May 4, 2016)
- Version 5.6 (Updated June 8, 2015)
- Version 5.5 (Updated May 4, 2015)
- Version 5.4 (Updated December 22, 2014)
- Version 5.3 (Updated May 7, 2014)
- Version 5.1 (Updated April 3, 2014)
- Version 5.0 (Updated May 31, 2013)
- Version 4.3 (Updated May 28, 2013)
- Version 4.0 (Updated March 6, 2013)
Version 5.9.0 (July 10, 2018)
- Compliant with GDPR policies
- Removed support for MoPub event adapters
- Fixed an issue with RegexMatcher that caused the app to hang when loading ads with certain resource URLs
- Fixed an issue when clicking on video ads caused the app to crash
Changes for Version 5.8.0 (December 12, 2017)
Changes for Version 5.8.2 (December 12, 2017)
Fixed a defect for fire devices: the banner ads were not loading.
Changes for Version 220.127.116.11 (September 29, 2016)
Fixed potential exception with video ad creatives.
Changes for Version 5.8.1 (August 9, 2016)
Added interstitial support for singleTask launch mode.
Fixed an issue that in some cases can result in a crash when the View Tree Observer dies
Known Issues and Best Practices
We've received reports that the Amazon MobPubSDK Adapter is no longer able to return Amazon Ads
- ClassCastException in com.amazon.device.ads.ViewabilityOverlapCalculator.findOverlapppingViews occurs infrequently on some Samsung 6.0.1 devices
- We've received reports of compatibility issues with Google Play Service 9.8 and 10.1
Ads appearing on the ASUS Transformer Prime TF201 have been known to experience rendering and click-related issues.
- Proguard obfuscation:
If you're obfuscating your app with ProGuard, ensure to add the following line to your ProGuard configuration:
-keep class com.google.android.gms.ads.identifier.AdvertisingIdClient
Failure to do so may result in your app being unable to access Google Play Services Advertising ID, which will lead to a rejection from the Google Play store.
If you're loading Amazon ads through a third party mediator SDK, be careful not to remove the
android.support.v7classes since doing so may prevent the mediator SDK from requesting Amazon ads. If you must remove one or more of these classes then make sure to only remove those exact class names and leave the others.
- Interstitial ads have not been certified for devices running Android 2.2 and below.
- Due to a known issue, Auto Ad Size failures may be incorrectly reported as
NO_FILLerrors. Correctly following the guidelines in the Auto Ad Size section when setting up your banner ad's layout will prevent these errors from occurring.
- It's possible for Auto Ad Size and Auto No Scale to return no ads if your
AdLayoutis too small or its size is not appropriate for the device loading the ad. If you would like to take advantage of Auto Ad Size or Auto No Scale for most screen sizes, it's recommended that you set the
AdLayout's width to
MATCH_PARENTand set the
AdLayout's height to
- If you're creating an
AdLayoutin memory to move onto the screen later, then you must not assign it a parent view until this move occurs. The
AdLayoutshould be added directly to the activity's view hierarchy. Do not add it to a parent view and then insert the parent view into the hierarchy as this could force ad loading to fail. See the Floating Ad Sample for an example implementation.
- Banner ads created in memory to be floated onto the screen later have been known to crop in rare cases on certain Android 4.0.x phones. You can avoid this problem by setting your app's target API to 13 or lower.
If banner ads do not scale to the proper size, you may be using a customized layout that fails to provide
AdLayoutwith the correct dimensions needed for scaling. You can fix this by hard-coding the correct dimensions into the
AdLayoutbefore attempting to load any ads. For example, if you want to load a 320x50 ad, adding the following line right before ads are loaded for the first time will ensure that the ad scales properly regardless of screen size or pixel density:
myAdLayout.setLayoutParams(new LayoutParams(320, 50));
- When a banner ad is reloaded using the same
AdLayout, rich media ad expansion is disabled to prevent the rich media ad from collapsing while users are interacting with it.
- When using an XML document to lay out your app, it is not recommended to use
If your app supports Android 3.x devices and contains
TextViews that can be modified by the user, we recommend that you add the following line to the
AndroidManifest.xmlfile in the section corresponding to the app in order to prevent the keyboard from appearing unexpectedly upon banner ad collapse:
During integration, you should set the enable testing flag to
trueto ensure that most ad requests return an ad. Test requests don't show up in your metrics, but allow you to test different ad types within your app. Call the
enableTestingfunction with a
trueargument to enable the test request. For example:
- The timeout value set through
AdLayout.setTimeout()only sets the timeout for retrieving an ad from the Amazon Ad Server. It does not account for the time it takes to load all the ad's referenced resources such as images.
- If your Application Key is invalid, the server will not return an ad.
AdListener.onAdFailedToLoad()will be called with Error Code
INTERNAL_ERRORand Error Message "Server Message: INVALID_APPID".
- Android emulators may have issues rendering some ads. Additionally, the emulators may not expose all functionality. For best results we recommend integration testing on actual Android devices.
- On Android 4.x devices you may see a blue border around ad images that have been clicked on.
AdLayout's parent applies padding, the ad will be scaled too large. If applying padding is desired, execute
AdSizeat load time.``
Version 5.7 (Updated May 4, 2016)
Changes for Version 5.7.2 (May 4, 2016)
- Created an optional Load Ad / Show Ad flow for Banner Ads.
- Added AdLayout.enableAutoShow API.
- Added AdLayout.disableAutoShow API.
- Added AdLayout.showAd API.
- Updated the Banner Ad Sample App to demonstrate the Load Ad / Show Banner Ad flow.
- Removed 300x50 Banner Ad Size.
- Resolved latency bug which could cause some devices to wait up to several seconds before loading an Ad.
Changes for Version 18.104.22.168 (March 25, 2016)
- Added MoPub Adapter sample app for Banner and Interstitial Ads.
- Fixed a rare
NullPointerExceptionissue that may occur when the ad position is being updated.
Changes for Version 5.7.1 (February 29, 2016)
- Removed support for Android 1.6 to 2.2. The Amazon Mobile Ads SDK now supports Android 2.3 and up.
- The Amazon Ad SDK is MRAID 2.0 certified.
- Added support for passing a
Contextto the banner
InterstitialAdconstructors. Previously these constructors required an
- Added a flag to the
AdSizeclass to disable scaling. This is helpful when applying padding to a layout.
- Fixed an
IllegalArgumentExceptionthat could occur in rare cases where the Ad's underlying WebView was constructed with an
Activityand not an application context.
- Addressed an issue that could cause a banner ad to scale improperly in the case that it is loaded off screen.
- Addressed minor 'Layout Preview' crashing issue while initializing an
AdLayoutin Android Studio having an ADT version 18 or higher.
- Removed ProGuard warning messages caused by deprecated
- Fixed a rare application crashing issue when loading an
AdLayoutthrough XML and then inflating into a Fragment instead of an
- Added mechanism to handle Android bug causing
ApplicationPackageManager.getApplicationLabel(ApplicationInfo info) to throw
Version 5.6 (Updated June 8, 2015)
Changes for Version 5.6.20 (June 10, 2015)
- A developer can now be notified when an
ModelessInterstitialAdexpires by implementing
- An expired
InterstitialAdcan now be reloaded before any attempts are made to show the ad.
- A developer can now determine if an
ModelessInterstitialAdis ready to show by calling
- A new ad size has been added. Auto No Scale will choose an ad using the same criteria as the normal Auto Ad Size process but will not upscale the ad any larger than its true device-independent pixel size; for example, a 320x50 ad will display as 320x50 dip even if its container is larger than 320x50. Please see Android Ad Concepts for more information.
- Fixed an issue involving automatic configuration updates.
- Updated sample apps for AndroidStudio compatibility.
Version 5.5 (Updated May 4, 2015)
Changes for Version 5.5.149 (May 4, 2015)
NullPointerExceptionthat could occur when the user exits the application or rotates the device during an ad load.
- Geolocation-enabled ad requests have been improved to enable multiple marketplaces while providing better accuracy and increased security.
Changes for Version 5.5.135 (April 23, 2015)
- Improved ad click-through functionality for opening browsers.
- Updated documentation for
Changes for Version 5.5.102 (March 24, 2015)
- Added Modeless Interstitial Ad Feature
- Added Swipeable and Framed Modeless Interstitial Ad Sample Apps
- Fixed an issue with AdActivity when the activity is resuming
- Fixed an issue where a back button pressed in an Interstitial Ad may result in a NullPointerException
- Fixed an issue with erroneous Google Advertising ID logging issue
- Fixed an issue where expandable ads may expand off screen
- Fixed an issue where AdSize.toString can return null
Version 5.4 (Updated December 22, 2014)
Changes for Version 5.4.235 (December 22, 2014)
- Added the
equalsoverride method to
Changes for Version 5.4.227 (November 18, 2014)
- Fixed an issue with transparent ads on Android 4.0.x versions.
Changes for Version 5.4.192 (November 4, 2014)
- Fixed an issue involving ads that would override the device's or app’s auto-rotate settings.
- Fixed an issue where a single
AdLayoutobject could start a new ad load before its previous ad load had completed.
- Addressed a race condition in which dismissing an interstitial ad using the native close button would sometimes put the ad into an abnormal state.
- Fixed an issue that had previously forced developers of ProGuard-obfuscated apps to add a specific
keepclassmembersline to their ProGuard files or risk the possibility of MRAID ads being unclickable. This line no longer needs to be added to the ProGuard file.
- Fixed an issue where the
onAdFailedToLoadcallback may have been fired multiple times for a single failed ad load.
- Resolved multiple issues related to load timeout functionality.
- Fixed a crash that had occurred when apps on certain devices attempted to destroy expanded rich media ads without first closing the ads.
- Removed incorrect floating ad banner logcat warnings.
- Handled an
IllegalArgumentExceptionthat could have been thrown while an ad was being destroyed.
- Fixed a
NullPointerExceptionthat sometimes occurred during
- Addressed an ad-specific issue that could have caused a
Changes for Version 5.4.146 (October 8, 2014)
- Fixed an issue where some intent URLs in the in-app browser would lead to a broken link.
- Added a new interface, ExtendedAdListener, which features an onAdResized() callback for when a banner ad is resized.
- Fixed an issue that had led to some devices being classified as “Other/Unknown” in performance reports.
- Added a debug log message to notify developers when an ad is scaling based on screen dimensions due to a missing parent view.
- Fixed an issue where interstitial ads on Android 4.4 devices would sometimes display a low-resolution image.
- Handled an uncommon IndexOutOfBoundsException thrown during network calls.
- Added support for the following MRAID 1.0 capabilities:
- mraid.useCustomClose() – Allows ad to use a custom close button image.
- mraid.close() – Closes an interstitial ad.
- mraid.isViewable() – Determines if the ad is currently viewable.
- mraid.getPlacementType() – Retrieves whether the ad is an interstitial or inline placement type.
- Added support for the following MRAID 2.0 capabilities:
- mraid.createCalendarEvent() – Prompts the user to add an event to the calendar.
- mraid.getCurrentPosition() – Gets the current size and position of the ad on the screen.
- mraid.getDefaultPosition() – Gets the default size and position of the ad on the screen.
- mraid.getMaxSize() – Gets the maximum expansion size of the ad.
- mraid.getScreenSize() – Gets the size of the device screen.
- mraid.storePicture() – Prompts the user to store a picture to the gallery.
- mraid.supports() – Determines what features the device supports.
- mraid.resize() – Performs a non-modal resize of the ad.
Changes for Version 5.4.78 (July 18, 2014)
- Fixed an uncommon
ArrayIndexOutOfBoundsExceptioncaused by Google Play Services Advertising ID collection.
- Resolved a
NullPointerExceptionrelated to Google Play Services Advertising ID collection.
- Previously, developers obfuscating or shrinking apps with ProGuard and distributing on Google Play would have been required to update the app package’s ProGuard file to keep certain classes, ensuring that the Google Advertising Identifier can be successfully collected. This update is no longer necessary.
Changes for Version 5.4.46 (June 26, 2014)
- Google Play Services Advertising Identifier is now supported. Because of new requirements detailed on Google’s policy page, all apps containing older versions of the Amazon Mobile Ads API must update to the current API or will no longer be eligible for upload to the Google Play Store after August 1, 2014. Developers of these apps must separately download and integrate the Google Play Services SDK by following the Google Play Services SDK Setup Instructions in order for the changes to take effect.
- Resolved scaling issues that had been present on Android 4.4 devices.
- Added a new button to in-app browser action bar. Pressing this button will allow users to open the current webpage in an external browser.
- Fixed a race condition where destroying an
AdLayoutcould lead to a
- Fixed an uncommon issue where clicking links in certain ads could cause a crash.
- Fixed a problem where loading ads would cause a crash due to Internet permissions being removed from the app.
AdTargetingOptions.setFloorPrice()now takes a parameter of type
int. Developers should not need to make an update as Java will automatically upcast from
Version 5.3 (Updated May 7, 2014)
Changes for Version 5.3.22 (May 7, 2014)
- Addressed a memory leak that could occur upon device rotation when an
InterstitialAdis instantiated and loaded in an activity's
Changes for Version 5.3.17 (May 2, 2014)
- Fixed an issue where
WebViewobjects were being destroyed outside of the UI thread. This would sometimes lead to crashes on apps with target API 18 or higher that would attempt to load ads on Android 4.3+ devices without internet connectivity.
Breaking Changes for Version 5.3.9 (April 24, 2014)
Amazon Mobile Ads API version 5.3 contains some breaking changes that include a modified
AdListener interface and a new error code. If you are upgrading to this version from an older version, your app may not compile until you have addressed the following:
- All callbacks in
AdListenerare now passed an
Adobject instead of an
AdLayoutobject. Note that
AdLayoutis an instance of
- A new callback,
onAdDismissed(), has been added to
AdListener. This callback will execute immediately after the user exits an interstitial ad.
- We added a new error code,
NETWORK_TIMEOUT, that is returned when the connection to the ad server timed out before the ad could be retrieved. This kind of error had previously been classified as a
Other Changes for Version 5.3.9 (April 24, 2014)
- Interstitial ads are now supported by the Amazon Mobile Ad Network. Online documentation and Javadocs have been updated to include instructions for these full-page ads, which are represented by the newly introduced
- A new interface,
Ad, has been introduced.
Adis implemented by both
- A new class,
DefaultAdListener, has been added as a default implementation of
AdListener. Developers are encouraged to create a custom listener that extends this class instead of implementing
- The Amazon Mobile Ads API’s in-app browser, which is displayed by some ads, now features larger and more visible navigation buttons.
- Fixed an uncommon issue where the
WifiManagerwould cause the app to crash.
- Changed ad rendering logic to account for a rare crash caused by setting a
- Resolved an issue that would prevent ads from detecting clicks in rare cases.
- Added a
loadAd()method that takes in no parameters. Developers are encouraged to use this method in cases where they would have previously passed in an empty
AdTargetingOptions.setGender()has been deprecated because this information is no longer used for targeting purposes.
- A new method,
setFloorPrice(), has been added to
AdTargetingOptions. This allows developers to the set the floor price (eCPM) of their ads without having to use
- Introduced a new sample app, Interstitial Ad Sample, for the purpose of demonstrating how to set up interstitial ads. See the Interstitial Ad Sample Page for more information.
- Updated the Simple Ad Sample and Floating Ad Sample apps based on recent changes.
Version 5.1 (Updated April 3, 2014)
Changes for Version 5.1.242 (April 3, 2014)
- Fixed a
ConcurrentModificationExceptionthat could occur when attempting to load an ad.
Changes for Version 5.1.236 (March 24, 2014)
- Reworded an error message that incorrectly said to reload an ad in the case where ad loading failed due to an app being disabled.
- Fixed a crash that would occur when the Internet permission was not present.
- Fixed an issue where a missing activity would cause the app to crash after an ad click.
Changes for Version 5.1.153 (October 28, 2013)
AdTargetingOptions.setAdvancedOption()will now throw an
IllegalArgumentExceptionif the key is
- Removed a deprecated API warning, "can't find referenced method
void setPluginsEnabled()," that would sometimes appear in the logcat. See the Amazon Mobile Ads Forum for more details.
- Addressed a threading issue caused by the WebViews and Views not being created on the same thread.
- Addressed runtime error with rich media ads on Android 1.6, where Bitmap Drawable Constructor would cause the app to exit.
- Removed reference warnings that would sometimes appear when ProGuard is used. See the Amazon Mobile Ads Forum for more details.
- Improved corrupt
WebViewdetection. See the Amazon Mobile Ads Forum for more details.
- Addressed several use cases resulting in
- Addressed use case resulting in
Changes for Version 5.1.40 (August 28, 2013)
- Resolved an issue where floating ad banners with view height set as WRAP_CONTENT would not render correctly on some Android 4.0 devices.
registerApp()now accepts a
- Removed a misleading "could not find method" error message that would appear in the logcat upon ad load attempts.
- The Amazon Mobile Ads API is now bundled as part of the Amazon Mobile App SDK download.
- This Release Notes page has been created to replace the README file that was previously included in the Amazon Mobile Ads API download. This page will be updated with each new release.
- Rich media expandable ads are supported on Android 4.1 and Android 4.2.
- The Auto Ad Size feature is now available for ads created in memory to be moved onto the screen at a later time. Examples of such ads can be seen in the Floating Ad Sample. Note that, if the
AdLayout's dimension is set to
MATCH_PARENTfor one of these ads, the activity's root view's corresponding dimension will be used for the Auto Ad Size calculation.
- Updated sample apps to use Auto Ad Size by default.
- Ad rendering no longer depends on resource files bundled inside the jar. This will make integration easier with Unity and other app development frameworks that had previously stripped these resource files from the jar during the integration process.
- Updated test ads and the Developer Launch Checklist to include new Pinzon test banner ad.
- Fixed an issue where floating ad banners would scale inconsistently on some older devices.
- AdLayouts created off the screen in memory must now have their layout parameters set ahead of time in order for ad loading to succeed. Leaving the parameters blank had previously caused ads to scale incorrectly.
Version 5.0 (Updated May 31, 2013)
Amazon Mobile Ads API version 5.0 contains a number of breaking changes. If you are upgrading to this version from an older version, your app may not compile until you have addressed the following:
- In the
VideoActionHandleractivity declarations should be removed. They have been replaced by a single
AdActivitydeclaration that must appear as follows:
<activity android:name="com.amazon.device.ads.AdActivity" android:configChanges="keyboardHidden|orientation|screenSize"/>
- The following
AdRegistrationmethods no longer accept a
Activityparameter instead of a more general
AdSizeenum has been replaced with a package-level
AdSizeclass. To specify a standard ad size, you should use one of the predefined
AdSizefields that take the form
SIZE_WxH. So, for example, if you previously set the ad size by passing
AdLayoutconstructor, you should instead pass in
AdSize.SIZE_320x50. Note that the process for setting the size via layout XML has not changed.
- The "custom" size is no longer accepted. To use a non-standard size, you will need to instantiate a new
AdSizeobject that takes width and height as its parameters and pass this into your
AdLayout. If setting the size via layout XML, you can now directly specify the dimensions using
AdLayoutconstructor now takes an
Activityparameter instead of a more general
- When using XML instantiation, please use the new namespace for the Amazon prefix as follows:
This replaces the previous namespace ending with
amazon_ads_attr.xmlfile is no longer required. Please remove it from your application.
- Resolved an issue where obfuscating an application's
Rclass would prevent ads from loading. You may now safely obfuscate your
- Fixed a memory leak issue related to lingering
- Documented a workaround for ensuring required resource files aren't removed during integration with Unity, Adobe AIR, or other development frameworks.
- Logcat messages from XML-instantiated layouts now log if they are warning or error.
- Introduced an additional layout XML
AdLayoutconstructor for accepting default style.
Version 4.3 (Updated May 28, 2013)
- Added an ad failure message to warn developers when required resource files have been removed from the APK.
- Introduced Auto Ad Size for ad banners. From now on, if
AdSizeis not specified in the
AdLayout's initialization within your app's XML or Java code, then an ad size will be automatically selected based upon the
AdLayout's size and the device's screen size.
- A new
AdLayoutconstructor that only requires app's context has been introduced. Any ads loaded within this
AdLayoutwill be sized through Auto Ad Size.
- Resolved an issue that prevented the Amazon Mobile Ads API from being obfuscated.
- Modified ad scaling behavior to ensure
AdLayouts with one dimension set to
WRAP_CONTENTwill resize based on the other dimension.
- Changed the "no results" error code from
- Handled a
NullPointerExceptionsometimes seen when the MAC Address could not be read.
- Resolved a SQLite database access conflict that occasionally prevented ads from loading.
- Fixed an issue in which package parameters could become double-encoded in the request URL, preventing ads from loading.
- Eliminated a rich media banner cropping issue that had affected Android 4.0 devices and had prompted a workaround that involved setting the
AdLayout's width to
MATCH_PARENT. This workaround is no longer necessary.
Version 4.0 (Updated March 6, 2013)
- Resolved an issue that sometimes prevented ads from loading due to an inability to read ad size from the app's XML files.
- The PDF version of the Developer Guide has been replaced by a shortcut that redirects to the online version of the Developer Guide. Open the shortcut using your web browser.
- All error messages have been redesigned for simplification purposes. See the updated Developer Guide or Javadocs for more information.
- This release is now compatible with the Amazon Mobile App SDK Eclipse Plugin. Note that you will need to extract the mobile ads zip file (MobileAds.zip) to the same folder as the Apps-SDK zip file (Apps-SDK.zip) to take advantage of this Eclipse plugin. Learn more by visiting the Eclipse Plugin Page.
- The deprecated
setAppUniqueID()have now been removed. Please use
- Instructions for updating open source attribution documents have been included in the "Updating Attributions" section of the Developer Guide.