Admob ads not showing up

后端 未结 14 1904
轮回少年
轮回少年 2021-01-02 02:31

I am trying to implement Admob in Android and I am seeing requests coming into AdMob. However, I am not seeing the Admob ads being displayed on the Android screen in the emu

14条回答
  •  有刺的猬
    2021-01-02 03:16

    Some of these possible solutions may sound obvious, but make sure you have these completed:

    -replace "My Publisher ID" in android:value="My Publisher ID" with your actual publisher ID.

    -make sure to include the internet permission in your manifest file:

       
    

    If you have completed those, you can also try placing the following code in the "On create" section instead of your current:

       AdView adView = (AdView)this.findViewById(R.id.adView);
       AdRequest adRequest = new AdRequest();
       adRequest.setTesting(true);
       adView.loadAd(adRequest);
       adView.loadAd(new AdRequest());
    

    or

        AdManager.setTestDevices( new String[] {AdManager.TEST_EMULATOR});
    
        AdView adView = (AdView)findViewById(R.id.adView);
        adView.requestFreshAd();
    

    Before publishing, don't forget be sure to get rid of the setTestDevice though!

提交回复
热议问题