Utilize both Play Services and AdMob SDK

前端 未结 4 1367
长情又很酷
长情又很酷 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: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 instead of .

    I think that's all. Good luck!

提交回复
热议问题