May 2019 Ad Manager API Workshop Slides
We are already planning future workshops, so be sure to check this blog for more updates. If you have general API questions or comments, please reach out to us on the Ad Manager API forums.
Earlier this week, Google Play services released a major update to many of its libraries to migrate all Android support library dependencies to Jetpack (using androidx.*
packages). This includes the play-services-ads
library from the Google Mobile Ads SDK, which has been updated to 18.0.0.
Earlier this week, Google Play services released a major update to many of its libraries to migrate all Android support library dependencies to Jetpack (using androidx.*
packages). This includes the play-services-ads
library from the Google Mobile Ads SDK, which has been updated to 18.0.0.
While the Google Mobile Ads SDK itself hasn’t changed between version 17.2.1 and 18.0.0, you’ll need to migrate your own app and all of your dependencies to AndroidX in order to pick up play-services-ads
18.0.0 or any future versions. This is particularly important if you use AdMob mediation, as several mediation partners have dependencies on Android support libraries that aren’t compatible with AndroidX.
To make the migration process as smooth as possible for you, Android Studio offers an easy way to convert your project and its dependencies to AndroidX using the Migrate to AndroidX option.
Android Studio 3.2 or higher includes a Refactor > Migrate to AndroidX menu option to convert your project to use AndroidX. We’ll demonstrate what happens when converting our BannerExample to AndroidX.
compileSdkVersion
to 28. This is a prerequisite for migrating to AndroidX.
Here is the project before the migration:
And here is the project afterwards:
First, you’ll notice that the package name for AppCompatActivity
has changed to androidx.appcompat.app
. The refactor has changed this project’s com.android.support:appcompat-v7:26.1.0
dependency to androidx.appcompat:appcompat:1.0.0
and fixed the associated imports.
Second, this migration added a gradle.properties file with these two lines:
android.useAndroidX=true android.enableJetifier=true
These properties ensure your project and its dependencies use AndroidX, by rewriting any binaries that are using an Android support library. See Using AndroidX for more details on these flags.
Now that your project is converted to AndroidX, you can safely update your play-services-ads dependency to 18.0.0 in your project-level build.gradle file:
dependencies { implementation 'androidx.appcompat:appcompat:1.0.0' implementation 'com.google.android.gms:play-services-ads:18.0.0' }
As always, you can follow the release notes to learn what’s changed in the Google Mobile Ads SDK. We’d also love to hear about how your migration went! If you have any questions about the release or have trouble migrating, please reach out to us on the Google Mobile Ads SDK developer forum.
- Eric Leichtenschlag, Mobile Ads Developer Relations
UniversalAppCampaignSetting
, which included both information about the app and references to media and descriptions that would be used for ads in that campaign.AppCampaignSetting
in the Google Ads API (UniversalAppCampaignInfo
in the AdWords API), which contains only basic details about the app you want to promote through advertising. All the specific ad-level details will be added in the new AppAdInfo
in the Google Ads API (UniversalAppAd
in the AdWords API). This improved structure allows you to have a single campaign for each app you want to advertise, and offers the flexibility to have a variety of different ads within that campaign.Affected Target Spend Fields | |
---|---|
Google Ads API | campaign.target_spend.target_spend_micros bidding_strategy.target_spend.target_spend_micros |
AdWords API | Campaign.BiddingStrategyConfiguration.TargetSpendBiddingScheme.spendTarget SharedBiddingStrategy.TargetSpendBiddingScheme.spendTarget |
OPERATION_NOT_PERMITTED_FOR_CONTEXT
UNSUPPORTED_FIELD_IS_SET
![]() | ![]() ![]() | ![]() | ||
![]() | ![]() | ![]() | ||
![]() ![]() | ![]() ![]() | |||
![]() |
| ![]() |