can't see ads (admob) on my android app
I'm trying to add some advertising to my app with admob, by I'm already using admob sdk 4.1.1. I saw开发者_如何学Python a few posts here but they refer older versions.
I only used xml configurations didn't change anything on java side. my code is:
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout android:layout_width="wrap_content"
<LinearLayout android:layout_width="wrap_content" xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:ads="http://schemas.android.com/apk/lib/com.google.ads"
android:id="@+id/linearLayout1" android:layout_height="wrap_content"
android:layout_alignParentBottom="true">
<com.google.ads.AdView android:id="@+id/adView"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
ads:adUnitId="--myUnitId--"
ads:adSize="BANNER"
ads:loadAdOnCreate="true"
/>
</LinearLayout>
The problem is that I can't see any ads in my app. I see some requests on admob dashboard, but zero impressions. Can anyone help me figure out what the problem is? Am I missing some code?
Thanks in advance,
João
Look into logcat - admob usually logs attempts to retrieve new ad. This is pretty comon that no ad is available or there is some connectivity problem
If you see requests on your AdMob dashboard, then you are likely getting the issue of "Ad Request successful, but no ad returned due to lack of inventory." AdMob doesn't always have an ad to show, and it typically takes multiple requests and some time for new apps to start receiving real ads.
Ads might be hiding behind or you might have pushed it out of the screen. You may use Relative Layout if you want the ads to be always displayed at the bottom.
Here is the code,
Android AdMob Position top of screen not working
精彩评论