I am trying to place Admob ads in my application and I followed all the instructions but did not work.
AdView adView = new AdView(this, AdSize.BANNER, "My_ID");
RelativeLayout.LayoutParams lp = new RelativeLayout.LayoutParams(RelativeLayout.LayoutParams.WRAP_CONTENT, RelativeLayout.LayoutParams.WRAP_CONTENT);
lp.addRule(RelativeLayout.ALIGN_PARENT_BOTTOM, RelativeLayout.TRUE);
flashCardPage.addView(adView, lp);
adView.loadAd(new AdRequest());
My manifest file contains an activity tag and two permissions, like a tutorial, but the banner does not appear on the screen. Interestingly, when I extracted all the Admob materials from my manifest file and launched the application, a banner appeared at the bottom of the screen saying that I need to allow Internet access and network access. Does anyone know what I'm doing wrong? I know that there are already many questions on this topic, but none of them helped. I tried changing my Admob account in test mode and adding an emulator as a test project, but that didn't work.
Should I try to use a different way of advertising? About a week has passed and Admob ads are still not showing.
When I launched the application on my phone today (August 10), I had a forced shutdown, so I think that if Admob causes this, even only in 1% -5% of cases, I will not use it.
source
share