English 中文(简体)
Android: AdMob 不显示
原标题:Android: AdMob Not Showing
  • 时间:2012-05-25 00:53:55
  •  标签:
  • admob

出于某种原因,在测试模式下运行我的AdMob时,我一无所获。 任何人都能看到任何明显的错误吗?

XML: (笑) (笑) (笑) (笑) (笑) (笑) (笑) (笑) (笑) (笑) (笑) (笑) (笑) (笑) (笑) (笑) (笑) (笑) (笑) (笑) (笑) (笑) (笑) (笑) (笑) (笑) (笑) (笑) (笑) (笑) (笑) (笑) (笑)

<?xml version="1.0" encoding="UTF-8"?>
    <RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
        xmlns:ads="http://schemas.android.com/apk/lib/com.google.ads"
        android:layout_width="fill_parent"
        android:layout_height="fill_parent" >


    <com.google.ads.AdView android:id="@+id/ad"
                           android:layout_width="wrap_content"
                           android:layout_height="wrap_content"
                           ads:adSize="BANNER"
                           ads:adUnitId="AD_ID"
                           ads:testDevices="TEST_EMULATOR,TEST_EMULATOR, DEVICE_ID"
                           ads:loadAdOnCreate="true"/>        

        <ImageView
            android:id="@+id/image"
            android:layout_width="fill_parent"
            android:layout_height="wrap_content"
            android:layout_centerHorizontal="true"
            android:layout_centerVertical="true"
            android:src="@android:drawable/alert_light_frame" />

    </RelativeLayout>

然后我的活动没有 任何东西在里面, 因为负载AdAdAdCreate是真实的。

最佳回答

于是我弄清楚了问题是什么!我用2.3电话运行这个, 低于AdMob所需的Android版本。当我在4.0 VM内运行的时候,它效果很好!

我给那些试图找出他们的AdMob有什么问题的人的提示: 直接使用XML( 高于代码), 因为这可以解决与您的 Java 的任何问题。 然后用VMs 而不是物理设备尝试它, 并阅读LogCat 查找任何问题 。 希望这有帮助!

问题回答

您需要指定

ads:adUnitId="AD_ID"

you can get it on your admob account. Should look something like

ads:adUnitId="a123456ff123456"

没有你的身份证,阿德人不会为你们做任何阿德人。





相关问题
How to show AdMob ads in real iPhone device?

I want to integrate AdMob ads in my iPhone app. I m using IB way to add the view and follow AdMob s pdf guide: 1. Add AdMob group(AdMobView.h,AdMobDelegateProtocol.h,libAdMob.a) 2. Add required ...

adding admob widget

i cant seem to figure out how to add the admob widget into my application. i want to add the widget to a linearlayout that is the child of a relative layout. the linerlayout was created just for the ...

AdMob SDK for iPad?

Trying to get my Universal app released and I rely on AdMob ads for revenue in this particular app. I m having an issue getting AdMob support working, though I keep finding references to people ...

Advertising API for Java ME applications?

I know AdMob is not for Java ME. Do you know any other advertising API or services that can be used in Java ME application? It might be really good if I can earn some money with my free Java ME ...

Admob in iPhone with Tabbar and TableView

I m having tab bar with 5 buttons. Out of 5 tabs, 2 are table views which uses navigation controller for showing sub views on click of cell. Above the tab bar, in each view I left some space for ads ...

What is correct xmlns url for AdMob in Android Layout XML

I am testing the AdMob for Android SDK. I can t set the admob:testing="true" because the admob attribute is unknown. <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" ...

热门标签