AdMob的广告没有显示出来 [英] Admob Ads is not showing up

查看:207
本文介绍了AdMob的广告没有显示出来的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

好吧,我做了很多的研究之前,我来这里(对不起,我的英语)。

我的问题是:我做了一个应用程序,我实现了Admob的4.3.1(我的应用程序developped在Android 3.2(使用Eclipse)

我第一次有错误你必须有互联网和ACCESS_NETWORK_STATE的权限,我把它们放在我的Andr​​oidManifest.xml,现在一切都还好,但是当我开始我的申请,我的广告没有显示出来。

我希望你能帮助我很快......非常感谢你。

下面是我的Andr​​oidManifest.xml:

 < XML版本=1.0编码=UTF-8&GT?;
<舱单的xmlns:机器人=htt​​p://schemas.android.com/apk/res/android
包=test.package.sound
安卓版code =1
机器人:VERSIONNAME =1.0>
<使用-权限的Andr​​oid:名称=android.permission.ACCESS_NETWORK_STATE/>
<使用-权限的Andr​​oid:名称=android.permission.INTERNET对/>

<应用
    机器人:图标=@可绘制/ GG
    机器人:标签=@字符串/ APP_NAME>
    <活动
        机器人:testpackagesoundNAME =
        机器人:标签=@字符串/ APP_NAME>
        <意向滤光器>
        <作用机器人:名称=android.intent.action.MAIN/>
        <类机器人:名称=android.intent.category.LAUNCHER/>
        &所述; /意图滤光器>
        < /活性GT;
    <活动
        机器人:TEST1NAME =
        机器人:标签=@字符串/ APP_NAME>
        < /活性GT;
    <活动
        机器人:TEST2NAME =
        机器人:标签=@字符串/ APP_NAME>
        < /活性GT;
    <活动
        机器人:TEST3NAME =
        机器人:标签=@字符串/ APP_NAME>
        < /活性GT;
        <元数据的android:值=XXXXXXXXXXXX机器人:NAME =ADMOB_PUBLISHER_ID/>
        <使用-SDK安卓的minSdkVersion =7/>
<活动机器人:名称=com.google.ads.AdActivity
android:configChanges="keyboard|keyboardHidden|orientation|screenLayout|uiMode|screenSize|smallestScreenSize"/>
< /用途>
< /舱单>
 

下面是我的布局:

 < XML版本=1.0编码=UTF-8&GT?;
< LinearLayout中的android:layout_width =FILL_PARENT
机器人:layout_height =match_parent
机器人:方向=垂直
机器人:背景=@可绘制/图像
的xmlns:机器人=htt​​p://schemas.android.com/apk/res/android
的xmlns:广告=htt​​p://schemas.android.com/apk/lib/com.google.ads>

<的LinearLayout
机器人:ID =@ + ID / linearLayout1
机器人:layout_width =match_parent
机器人:layout_height =WRAP_CONTENT>


<按钮
    机器人:ID =@ + ID /按钮1
    机器人:layout_width =WRAP_CONTENT
    机器人:layout_height =match_parent
    机器人:文本=测试1
    机器人:文字颜色=#005113/>


<按钮
    机器人:ID =@ + ID /按钮3
    机器人:layout_width =WRAP_CONTENT
    机器人:layout_height =match_parent
    机器人:文本=测试2
    机器人:文字颜色=#970000/>





<按钮
    机器人:ID =@ + ID /按钮2
    机器人:layout_width =WRAP_CONTENT
    机器人:layout_height =match_parent
    机器人:文本=TEST3
    机器人:文字颜色=#001760/>

< / LinearLayout中>
<的LinearLayout
的xmlns:机器人=htt​​p://schemas.android.com/apk/res/android
的xmlns:广告=htt​​p://schemas.android.com/apk/lib/com.google.ads
机器人:ID =@ + ID / linearLayout1
机器人:layout_width =match_parent
机器人:layout_height =50dip>

< com.google.ads.AdView
    机器人:ID =@ + ID / AD浏览报
    机器人:layout_width =WRAP_CONTENT
    机器人:layout_height =WRAP_CONTENT
    机器人:layout_centerInParent =真
    广告:adSize =大旗
    广告:adUnitId =XXXXXXXXXX
    广告:loadAdOnCreate =真正的>
< /com.google.ads.AdView>


< / LinearLayout中>
<滚动型
机器人:layout_width =FILL_PARENT
机器人:layout_height =WRAP_CONTENT
机器人:layout_weight =1
机器人:fillViewport =真正的>
<的LinearLayout
机器人:layout_width =300像素
机器人:layout_height =FILL_PARENT
机器人:方向=垂直
机器人:layout_gravity =center_horizo​​ntal
>
<按钮
机器人:ID =@ + ID /将Button4
机器人:layout_width =FILL_PARENT
机器人:layout_height =WRAP_CONTENT
机器人:文本=TEST4/>
   <按钮
机器人:ID =@ + ID / button18
机器人:layout_width =FILL_PARENT
机器人:layout_height =WRAP_CONTENT
机器人:文本=test18/>

< / LinearLayout中>
< /滚动型>
< / LinearLayout中>
 

解决方案

广告将不会显示,如果没有足够的空间布局。检查logcat的日志中的任何及所有广告相关的消息。看到这个 Admob的广告没有展示 - 安卓的有关建议,如果是这样的话

Okay I made a lot of research before I came here (sorry for my english).

My problem is : I made an application and I implement Admob 4.3.1 (my application is developped on Android 3.2 (with eclipse).

First time I was having the error "You must have INTERNET and ACCESS_NETWORK_STATE permission, I put them on my AndroidManifest.xml, now all is okay but when I start my application, my ads are not showing up.

I hope you can help me soon... thank you very much.

Here is my AndroidManifest.xml:

<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="test.package.sound"
android:versionCode="1"
android:versionName="1.0" >
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE"/>
<uses-permission android:name="android.permission.INTERNET"/>

<application
    android:icon="@drawable/gg"
    android:label="@string/app_name" >
    <activity
        android:name=".testpackagesound"
        android:label="@string/app_name" >
        <intent-filter>
        <action android:name="android.intent.action.MAIN" />
        <category android:name="android.intent.category.LAUNCHER" />
        </intent-filter>
        </activity>
    <activity
        android:name=".test1"
        android:label="@string/app_name" >
        </activity>
    <activity
        android:name=".test2"
        android:label="@string/app_name" >
        </activity>
    <activity
        android:name=".test3"
        android:label="@string/app_name">
        </activity>
        <meta-data android:value="xxxxxxxxxxxx" android:name="ADMOB_PUBLISHER_ID" />
        <uses-sdk android:minSdkVersion="7" />
<activity android:name="com.google.ads.AdActivity"
android:configChanges="keyboard|keyboardHidden|orientation|screenLayout|uiMode|screenSize|smallestScreenSize"/>
</application>
</manifest>

Here is my Layout :

<?xml version="1.0" encoding="utf-8"?>
<LinearLayout android:layout_width="fill_parent"
android:layout_height="match_parent"
android:orientation="vertical"
android:background="@drawable/image"
xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:ads="http://schemas.android.com/apk/lib/com.google.ads">

<LinearLayout
android:id="@+id/linearLayout1"
android:layout_width="match_parent"
android:layout_height="wrap_content" >


<Button
    android:id="@+id/button1"
    android:layout_width="wrap_content"
    android:layout_height="match_parent"
    android:text="test1"
    android:textColor="#005113" />


<Button
    android:id="@+id/button3"
    android:layout_width="wrap_content"
    android:layout_height="match_parent"
    android:text="test2"
    android:textColor="#970000" />





<Button
    android:id="@+id/button2"
    android:layout_width="wrap_content"
    android:layout_height="match_parent"
    android:text="test3"
    android:textColor="#001760" />

</LinearLayout>
<LinearLayout
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_width="match_parent"
android:layout_height="50dip" >

<com.google.ads.AdView
    android:id="@+id/adView"
    android:layout_width="wrap_content"
    android:layout_height="wrap_content"
    android:layout_centerInParent="true"
    ads:adSize="BANNER"
    ads:adUnitId="xxxxxxxxxx"
    ads:loadAdOnCreate="true" >
</com.google.ads.AdView>


</LinearLayout>
<ScrollView
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:layout_weight="1"
android:fillViewport="true" >
<LinearLayout 
android:layout_width="300px"
android:layout_height="fill_parent"
android:orientation="vertical"
android:layout_gravity="center_horizontal"
>
<Button
android:id="@+id/button4"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:text="test4" />
   <Button
android:id="@+id/button18"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:text="test18" />

</LinearLayout>
</ScrollView>
</LinearLayout>

解决方案

Ads will not display if there is not enough room to in the layout. Check the logcat log for any and all ad related messages. See this Admob ads not showing - Android for suggestions if this is the case.

这篇关于AdMob的广告没有显示出来的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆