Today we’re announcing the release of v7.0 of the Google Mobile Ads SDK! It’s listed as Google Play services (Rev. 23) in the Android SDK manager, and is available for download right now. Those of you using Android Studio can download Google Repository (Rev. 16) to get the latest Gradle artifacts. This release contains a number of stability and performance improvements, as well as some new features.
DFP developers can take advantage of two other new methods in PublisherAdRequest.Builder : addCustomTargeting and addCategoryExclusion .
Previously, developers had to add custom targeting information to a request by creating a Bundle and passing it to addNetworkExtrasBundle . This can now be done with a simple call to the addCustomTargeting method:
PublisherAdRequest newRequest = new PublisherAdRequest.Builder()
.addCustomTargeting("some_key", "some_value")
.addCustomTargeting("some_other_key", aListOfStringValues)
.build();
The new addCategoryExclusion method makes setting a slot-level category exclusion label for a request just as straightforward:
PublisherAdRequest newRequest = new PublisherAdRequest.Builder()
.addCategoryExclusion("some_unwanted_category")
.addCategoryExclusion("some_other_unwanted_category")
.build();
Another new feature is the setRequestAgent method that’s been added to AdRequest.Builder and PublisherAdRequest.Builder . Third party libraries that reference the Mobile Ads SDK should call this method to denote the platform from which the ad request originated. For example, if a third-party ad network called "CoolAds" mediates requests to the Mobile Ads SDK, it should call this method with "CoolAds":
AdRequest newRequest = new AdRequest.Builder()
.setRequestAgent("CoolAds")
.build();
This SDK release coincides with version 7.0 of Google Play services, which was recently announced on the Android Developer blog . For a full list of Mobile Ads SDK changes, check out our release notes . For technical questions, post them on our forum .
- Andrew Brogdon , Mobile Ads Developer Relations