在我的Android应用上看不到广告(admob)

时间:2011-10-11 14:31:55

标签: android admob ads

我正在尝试使用admob向我的应用添加一些广告,因为我已经在使用admob sdk 4.1.1。 我在这里看到了一些帖子,但是它们引用了旧版本。

我只使用xml配置在java端没有改变任何东西。我的代码是:

<?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> 

问题是我在我的应用中看不到任何广告。我在admob仪表板上看到了一些请求,但零印象。任何人都可以帮我弄清问题是什么?我错过了一些代码吗?

提前致谢,

若昂

3 个答案:

答案 0 :(得分:0)

查看logcat - admob通常会记录尝试检索新广告的情况。这很简单,没有广告可用或存在一些连接问题

答案 1 :(得分:0)

如果您在AdMob信息中心上看到了请求,那么您可能会遇到“广告请求成功,但由于缺少广告资源而无法返回广告”的问题。 AdMob并不总是要展示广告,并且通常需要多个请求以及新应用开始接收真实广告的时间。

答案 2 :(得分:0)

广告可能隐藏在后面,或者您可能已将其推出屏幕。如果您希望广告始终显示在底部,则可以使用相对布局。

这是代码,

Android AdMob Position top of screen not working

相关问题