Utilize both Play Services and AdMob SDK

前端 未结 4 1361
长情又很酷
长情又很酷 2020-12-08 08:13

As MH. pointed out in this question, one no longer needs to include GoogleAdMobAdsSdk-x.x.x.jar in their Android project if they include Google Play Services (see the migrat

相关标签:
4条回答
  • 2020-12-08 08:27

    You can use Google Play Services v12 which does not include the overlapping namespaces. It can be downloaded using the Android's SDK Manager under "Extras" -> "Google Play Services for Froyo". This version will co-exist with AdMob stand alone SDK.

    Over time Google will probably deprecate both.

    Update: Google has announced the deprecation of the stand alone AdMob SDK, you must move to Google Play SDK:

    On August 1, 2014, Google Play will stop accepting new or updated apps that use the old standalone Google Mobile Ads SDK v6.4.1 or lower. You must upgrade to the Google Play version of the Mobile Ads SDK by then.

    0 讨论(0)
  • 2020-12-08 08:29

    I've been testing this, and some changes are required in order to get this working through Google Play Services.

    In first place you should remove all imports referencing to old com.google.ads.* , since they are now located on com.google.android.gms.ads.*.

    As you mentioned, some more changes need to be done:

    You cannot instantiate an AdRequest the way it used to be done, but using an AdRequest.Builder as follows:

    AdRequest adRequest = new AdRequest.Builder().build();
    

    Also, make sure you replace the name of the package on all layouts, so they call <com.google.android.gms.ads.AdView instead of <com.google.ads.AdView.

    I think that's all. Good luck!

    0 讨论(0)
  • 2020-12-08 08:31

    Detailed Google Play Services Migration for AdMob is available here: https://developers.google.com/mobile-ads-sdk/docs/admob/play-migration

    0 讨论(0)
  • 2020-12-08 08:41

    I think i got the attention of Google/Android for the issue,

    https://code.google.com/p/android/issues/detail?id=63007

    0 讨论(0)
提交回复
热议问题