I try to add admob, but I have some problem with it.
This is the code for the test, it looks ok:
AdView adView = new AdView(this, AdSize.BANNER, pubID);
AdRequest adRequest = new AdRequest();
adRequest.addTestDevice(AdRequest.TEST_EMULATOR); // Emulator
adRequest.addTestDevice("TEST_DEVICE_ID");
adView.loadAd(adRequest);
And this code with pubID
AdView adView = new AdView(this, AdSize.BANNER, pubID);
adView.loadAd(new AdRequest());
I can’t understand what’s wrong… Just admob is not showing. That’s all…
Can anyone help me with this problem?
Regards, Peter.
UPD oh sorry. Also all settings set in manifest file( permission , and adsense activity)
upd
all response from admob in logcat :
01-11 21:49:31.805: I/Ads(363): To get test ads on this device, call adRequest.addTestDevice(AdRequest.TEST_EMULATOR);
01-11 21:49:33.405: I/Ads(363): adRequestUrlHtml: <html><head><script src="http://media.admob.com/sdk-core-v40.js"></script><script>AFMA_buildAdURL({"preqs":0,"u_sd":1,"slotname":"a14f0d9ca22bc53","u_w":320,"msid":"activityM.activity.com","simulator":1,"cap":"m,a","js":"afma-sdk-a-v4.3.1","isu":"B3EEABB8EE11C2BE770B684D95219ECB","cipa":0,"format":"320x50_mb","net":"ed","app_name":"1.android.activityM.activity.com","hl":"en","u_h":480,"u_audio":4});</script></head><body></body></html>
01-11 21:49:41.714: I/Ads(363): Received ad url: <"url": "http://googleads.g.doubleclick.net:80/mads/gma?preqs=0&u_sd=1&slotname=a14f0d9ca22bc53&u_w=320&msid=activityM.activity.com&cap=m%2Ca&js=afma-sdk-a-v4.3.1&isu=B3EEABB8EE11C2BE770B684D95219ECB&cipa=0&format=320x50_mb&net=ed&app_name=1.android.activityM.activity.com&hl=en&u_h=480&u_audio=4&u_so=p&output=html®ion=mobile_app&u_tz=0&ex=1&client_sdk=1&pto=0&jsv=1", "afmaNotifyDt": "null">
01-11 21:49:42.255: I/Ads(363): onFailedToReceiveAd(Ad request successful, but no ad returned due to lack of ad inventory.)
That’s all what i found in ddms.
This tells all.
01-11 21:49:42.255: I/Ads(363): onFailedToReceiveAd(Ad request successful, but no ad returned due to lack of ad inventory.)This has happened to me sometimes. They just don’t have any ads to send out at the moment for whatever reason. They will eventually pop up when they have something in their inventory. Nothing to worry about, just keep checking and it will eventually pop up.