Adwhirl 广告未展示

发布于 2024-11-18 02:57:54 字数 6256 浏览 2 评论 0原文

我有一个 Android 应用程序,我将 Adwhirl 与 Admob 和 ZestADZ 一起使用,并且我设置了一个自家广告。

由于某种原因,尽管日志看起来正常,但广告没有显示。我所看到的是 Zest 广告没有显示,它应该默认为我创建的自家广告。

提前致谢!

这是我的 XML 的一部分:

LinearLayout
android:id="@+id/LayoutTopAds"
android:orientation="horizontal"
android:layout_height="0dp"
android:layout_width="fill_parent"
android:gravity="center_horizontal"
android:background="@color/graphite"
android:layout_weight="0.5"

这是代码:

    LinearLayout adLayout = (LinearLayout)findViewById(R.id.LayoutTopAds);
    AdWhirlLayout adWhirlLayout = new AdWhirlLayout(this, LearningLangConsts.ADWHIRL_SDK_KEY[myUI.LEARNLANG]);

    int diWidth = adLayout.getWidth();
    int diHeight = adLayout.getHeight();
    float density = getResources().getDisplayMetrics().density;

    adWhirlLayout.setAdWhirlInterface(new AdWhirlLayout.AdWhirlInterface()
    {
        @Override
        public void adWhirlGeneric()
        {}
    });

    adWhirlLayout.setMaxWidth((int)(diWidth * density));
    adWhirlLayout.setMaxHeight((int)(diHeight * density));
    adLayout.addView(adWhirlLayout);  

这是日志:

      07-02 16:36:56.791: INFO/AdWhirl SDK(3581): Creating adWhirlManager...
      07-02 16:36:56.851: DEBUG/AdWhirl SDK(3581): Locale is: en_US
      07-02 16:36:57.354: DEBUG/AdWhirl SDK(3581): Hashed device ID is: 7d1dd13a2fa91c0ad174cb69a11549a3
      07-02 16:36:57.360: INFO/AdWhirl SDK(3581): Finished creating adWhirlManager
      07-02 16:36:58.140: DEBUG/AdWhirl SDK(3581): Prefs{73dd1111860847ecb1257a0e0942ec37}: {"config": "{"extra":{"location_on":1,"background_color_rgb":{"red":255,"green":255,"blue":255,"alpha":1},"text_color_rgb":{"red":0,"green":0,"blue":0,"alpha":1},"cycle_time":15,"transition":8},"rations":[{"nid":"7f5ef65976504f21b9635ab0ec19a019","type":1,"nname":"admob","weight":33,"priority":3,"key":"a14123cc7d16913"},{"nid":"49ac21c2a998e168ae8974078a302c0b","type":20,"nname":"zestadz","weight":33,"priority":1,"key":"14131C047A5040548959435145554B5F8D8A29CA"},{"nid":"e7eff2754b0b4bde81114881e88dd8f1","type":9,"nname":"custom","weight":34,"priority":2,"key":"__CUSTOM__"},{"nid":"8c1200a3a29d41c0b9fd16096368d6dc","type":9,"nname":"custom","weight":0,"priority":2,"key":"__CUSTOM__"}]}
      07-02 16:36:58.140: DEBUG/AdWhirl SDK(3581): ", "timestamp": 1309645632265}
      07-02 16:36:58.150: INFO/AdWhirl SDK(3581): Using stored config data
      07-02 16:36:58.181: DEBUG/AdWhirl SDK(3581): Received jsonString: {"extra":{"location_on":1,"background_color_rgb":{"red":255,"green":255,"blue":255,"alpha":1},"text_color_rgb":{"red":0,"green":0,"blue":0,"alpha":1},"cycle_time":15,"transition":8},"rations":[{"nid":"7f5ef65926c44f21b9635ab0e122a019","type":1,"nname":"admob","weight":33,"priority":3,"key":"a14e0dcc7d16913"},{"nid":"49ac243ae94c4f68ae8974078a302c0b","type":20,"nname":"zestadz","weight":33,"priority":1,"key":"14131C047A504052787735145554B5F8D8A29CA"},{"nid":"e7eff27c4b0b4bd3222db881e88dd8f1","type":9,"nname":"custom","weight":34,"priority":2,"key":"__CUSTOM__"},{"nid":"8c1200a3a29d41c0b9fd16834423d6dc","type":9,"nname":"custom","weight":0,"priority":2,"key":"__CUSTOM__"}]}
      07-02 16:36:59.953: INFO/AdWhirl SDK(3581): Rotating Ad
      07-02 16:37:00.080: DEBUG/AdWhirl SDK(3581): Dart is <8.98131054165815> of <100.0>
      07-02 16:37:01.890: DEBUG/AdWhirl SDK(3581): Showing ad:
      07-02 16:37:01.890: DEBUG/AdWhirl SDK(3581):     nid: 49ac21c2a94c4f68154434078a302c0b
      07-02 16:37:01.890: DEBUG/AdWhirl SDK(3581):     name: zestadz
      07-02 16:37:01.890: DEBUG/AdWhirl SDK(3581):     type: 20
      07-02 16:37:01.890: DEBUG/AdWhirl SDK(3581):     key: 14349877A5040434E59435145554B5F8D8A29CA
      07-02 16:37:01.890: DEBUG/AdWhirl SDK(3581):     key2: 
      07-02 16:37:01.943: DEBUG/AdWhirl SDK(3581): Valid adapter, calling handle()
      07-02 16:37:01.970: INFO/ZestADZ SDK(3581): Adclient ID set to 14131C047A5040434E59435145554B5F8D8A29CA
      07-02 16:37:04.730: VERBOSE/Formed URL(3581): http://a.zestadz.com/waphandler/deliverad?ua=Mozilla%2F5.0+%28Linux%3B+U%3B+Android+2.1-update1%3B+en-us%3B+sdk+Build%2FECLAIR%29+AppleWebKit%2F530.17+%28KHTML%2C+like+Gecko%29+Version%2F4.0+Mobile+Safari%2F530.17&ip=&cid=14131C047A504342216435145554B5F8D8A29CA&meta=game&keyword=All
      07-02 16:37:09.921: DEBUG/Ad Response(3581): HTTP/1.1 200 OK
      07-02 16:37:10.040: DEBUG/AdWhirl SDK(3581): ZestADZ failure
      07-02 16:37:10.351: DEBUG/AdWhirl SDK(3581): Showing ad:
      07-02 16:37:10.351: DEBUG/AdWhirl SDK(3581):     nid: 49ac21c2a94c4f68ae835645987302c0b
      07-02 16:37:10.351: DEBUG/AdWhirl SDK(3581):     name: zestadz
      07-02 16:37:10.351: DEBUG/AdWhirl SDK(3581):     type: 20
      07-02 16:37:10.351: DEBUG/AdWhirl SDK(3581):     key: 14131234487040434E59435145554B5F8D8A29CA
      07-02 16:37:10.351: DEBUG/AdWhirl SDK(3581):     key2: 
      07-02 16:37:10.372: DEBUG/AdWhirl SDK(3581): Valid adapter, calling handle()
      07-02 16:37:10.400: INFO/ZestADZ SDK(3581): Adclient ID set to 14131C047A5040434E59435640954B5F8D8A29CA
      07-02 16:37:11.432: VERBOSE/Formed URL(3581): http://a.zestadz.com/waphandler/deliverad?ua=Mozilla%2F5.0+%28Linux%3B+U%3B+Android+2.1-update1%3B+en-us%3B+sdk+Build%2FECLAIR%29+AppleWebKit%2F530.17+%28KHTML%2C+like+Gecko%29+Version%2F4.0+Mobile+Safari%2F530.17&ip=&cid=14131C047A501233329435145554B5F8D8A29CA&meta=game&keyword=All
      07-02 16:37:13.060: DEBUG/Ad Response(3581): HTTP/1.1 200 OK
      07-02 16:37:13.190: DEBUG/AdWhirl SDK(3581): ZestADZ failure
      07-02 16:37:13.530: DEBUG/AdWhirl SDK(3581): Showing ad:
      07-02 16:37:13.530: DEBUG/AdWhirl SDK(3581):     nid: e7eff27c4b0b4bd455223381e88dd8f1
      07-02 16:37:13.530: DEBUG/AdWhirl SDK(3581):     name: custom
      07-02 16:37:13.530: DEBUG/AdWhirl SDK(3581):     type: 9
      07-02 16:37:13.530: DEBUG/AdWhirl SDK(3581):     key: __CUSTOM__
      07-02 16:37:13.530: DEBUG/AdWhirl SDK(3581):     key2: 
      07-02 16:37:13.550: DEBUG/AdWhirl SDK(3581): Valid adapter, calling handle()
      07-02 16:37:13.670: DEBUG/LocationManager(3581): Constructor: service = android.location.ILocationManager$Stub$Proxy@43baf168

I have an Android app, and I'm using Adwhirl with Admob and ZestADZ, and I've set up a House ad.

For some reason the ads are not showing, in spite of the log looking normal. All I can see is that the Zest ads are not shown and it should default to House ads I create.

Thanks in advance!

Here is part of my XML:

LinearLayout
android:id="@+id/LayoutTopAds"
android:orientation="horizontal"
android:layout_height="0dp"
android:layout_width="fill_parent"
android:gravity="center_horizontal"
android:background="@color/graphite"
android:layout_weight="0.5"

Here is the code:

    LinearLayout adLayout = (LinearLayout)findViewById(R.id.LayoutTopAds);
    AdWhirlLayout adWhirlLayout = new AdWhirlLayout(this, LearningLangConsts.ADWHIRL_SDK_KEY[myUI.LEARNLANG]);

    int diWidth = adLayout.getWidth();
    int diHeight = adLayout.getHeight();
    float density = getResources().getDisplayMetrics().density;

    adWhirlLayout.setAdWhirlInterface(new AdWhirlLayout.AdWhirlInterface()
    {
        @Override
        public void adWhirlGeneric()
        {}
    });

    adWhirlLayout.setMaxWidth((int)(diWidth * density));
    adWhirlLayout.setMaxHeight((int)(diHeight * density));
    adLayout.addView(adWhirlLayout);  

Here is the log:

      07-02 16:36:56.791: INFO/AdWhirl SDK(3581): Creating adWhirlManager...
      07-02 16:36:56.851: DEBUG/AdWhirl SDK(3581): Locale is: en_US
      07-02 16:36:57.354: DEBUG/AdWhirl SDK(3581): Hashed device ID is: 7d1dd13a2fa91c0ad174cb69a11549a3
      07-02 16:36:57.360: INFO/AdWhirl SDK(3581): Finished creating adWhirlManager
      07-02 16:36:58.140: DEBUG/AdWhirl SDK(3581): Prefs{73dd1111860847ecb1257a0e0942ec37}: {"config": "{"extra":{"location_on":1,"background_color_rgb":{"red":255,"green":255,"blue":255,"alpha":1},"text_color_rgb":{"red":0,"green":0,"blue":0,"alpha":1},"cycle_time":15,"transition":8},"rations":[{"nid":"7f5ef65976504f21b9635ab0ec19a019","type":1,"nname":"admob","weight":33,"priority":3,"key":"a14123cc7d16913"},{"nid":"49ac21c2a998e168ae8974078a302c0b","type":20,"nname":"zestadz","weight":33,"priority":1,"key":"14131C047A5040548959435145554B5F8D8A29CA"},{"nid":"e7eff2754b0b4bde81114881e88dd8f1","type":9,"nname":"custom","weight":34,"priority":2,"key":"__CUSTOM__"},{"nid":"8c1200a3a29d41c0b9fd16096368d6dc","type":9,"nname":"custom","weight":0,"priority":2,"key":"__CUSTOM__"}]}
      07-02 16:36:58.140: DEBUG/AdWhirl SDK(3581): ", "timestamp": 1309645632265}
      07-02 16:36:58.150: INFO/AdWhirl SDK(3581): Using stored config data
      07-02 16:36:58.181: DEBUG/AdWhirl SDK(3581): Received jsonString: {"extra":{"location_on":1,"background_color_rgb":{"red":255,"green":255,"blue":255,"alpha":1},"text_color_rgb":{"red":0,"green":0,"blue":0,"alpha":1},"cycle_time":15,"transition":8},"rations":[{"nid":"7f5ef65926c44f21b9635ab0e122a019","type":1,"nname":"admob","weight":33,"priority":3,"key":"a14e0dcc7d16913"},{"nid":"49ac243ae94c4f68ae8974078a302c0b","type":20,"nname":"zestadz","weight":33,"priority":1,"key":"14131C047A504052787735145554B5F8D8A29CA"},{"nid":"e7eff27c4b0b4bd3222db881e88dd8f1","type":9,"nname":"custom","weight":34,"priority":2,"key":"__CUSTOM__"},{"nid":"8c1200a3a29d41c0b9fd16834423d6dc","type":9,"nname":"custom","weight":0,"priority":2,"key":"__CUSTOM__"}]}
      07-02 16:36:59.953: INFO/AdWhirl SDK(3581): Rotating Ad
      07-02 16:37:00.080: DEBUG/AdWhirl SDK(3581): Dart is <8.98131054165815> of <100.0>
      07-02 16:37:01.890: DEBUG/AdWhirl SDK(3581): Showing ad:
      07-02 16:37:01.890: DEBUG/AdWhirl SDK(3581):     nid: 49ac21c2a94c4f68154434078a302c0b
      07-02 16:37:01.890: DEBUG/AdWhirl SDK(3581):     name: zestadz
      07-02 16:37:01.890: DEBUG/AdWhirl SDK(3581):     type: 20
      07-02 16:37:01.890: DEBUG/AdWhirl SDK(3581):     key: 14349877A5040434E59435145554B5F8D8A29CA
      07-02 16:37:01.890: DEBUG/AdWhirl SDK(3581):     key2: 
      07-02 16:37:01.943: DEBUG/AdWhirl SDK(3581): Valid adapter, calling handle()
      07-02 16:37:01.970: INFO/ZestADZ SDK(3581): Adclient ID set to 14131C047A5040434E59435145554B5F8D8A29CA
      07-02 16:37:04.730: VERBOSE/Formed URL(3581): http://a.zestadz.com/waphandler/deliverad?ua=Mozilla%2F5.0+%28Linux%3B+U%3B+Android+2.1-update1%3B+en-us%3B+sdk+Build%2FECLAIR%29+AppleWebKit%2F530.17+%28KHTML%2C+like+Gecko%29+Version%2F4.0+Mobile+Safari%2F530.17&ip=&cid=14131C047A504342216435145554B5F8D8A29CA&meta=game&keyword=All
      07-02 16:37:09.921: DEBUG/Ad Response(3581): HTTP/1.1 200 OK
      07-02 16:37:10.040: DEBUG/AdWhirl SDK(3581): ZestADZ failure
      07-02 16:37:10.351: DEBUG/AdWhirl SDK(3581): Showing ad:
      07-02 16:37:10.351: DEBUG/AdWhirl SDK(3581):     nid: 49ac21c2a94c4f68ae835645987302c0b
      07-02 16:37:10.351: DEBUG/AdWhirl SDK(3581):     name: zestadz
      07-02 16:37:10.351: DEBUG/AdWhirl SDK(3581):     type: 20
      07-02 16:37:10.351: DEBUG/AdWhirl SDK(3581):     key: 14131234487040434E59435145554B5F8D8A29CA
      07-02 16:37:10.351: DEBUG/AdWhirl SDK(3581):     key2: 
      07-02 16:37:10.372: DEBUG/AdWhirl SDK(3581): Valid adapter, calling handle()
      07-02 16:37:10.400: INFO/ZestADZ SDK(3581): Adclient ID set to 14131C047A5040434E59435640954B5F8D8A29CA
      07-02 16:37:11.432: VERBOSE/Formed URL(3581): http://a.zestadz.com/waphandler/deliverad?ua=Mozilla%2F5.0+%28Linux%3B+U%3B+Android+2.1-update1%3B+en-us%3B+sdk+Build%2FECLAIR%29+AppleWebKit%2F530.17+%28KHTML%2C+like+Gecko%29+Version%2F4.0+Mobile+Safari%2F530.17&ip=&cid=14131C047A501233329435145554B5F8D8A29CA&meta=game&keyword=All
      07-02 16:37:13.060: DEBUG/Ad Response(3581): HTTP/1.1 200 OK
      07-02 16:37:13.190: DEBUG/AdWhirl SDK(3581): ZestADZ failure
      07-02 16:37:13.530: DEBUG/AdWhirl SDK(3581): Showing ad:
      07-02 16:37:13.530: DEBUG/AdWhirl SDK(3581):     nid: e7eff27c4b0b4bd455223381e88dd8f1
      07-02 16:37:13.530: DEBUG/AdWhirl SDK(3581):     name: custom
      07-02 16:37:13.530: DEBUG/AdWhirl SDK(3581):     type: 9
      07-02 16:37:13.530: DEBUG/AdWhirl SDK(3581):     key: __CUSTOM__
      07-02 16:37:13.530: DEBUG/AdWhirl SDK(3581):     key2: 
      07-02 16:37:13.550: DEBUG/AdWhirl SDK(3581): Valid adapter, calling handle()
      07-02 16:37:13.670: DEBUG/LocationManager(3581): Constructor: service = android.location.ILocationManager$Stub$Proxy@43baf168

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

歌入人心 2024-11-25 02:57:54

看起来您将 LinearLayout 高度设置为 0dpandroid:layout_height="0dp"
这将导致您的视图不显示。尝试将其更改为 wrap_content。如果这不起作用,实际上有一种更简单的方法来创建 AdWhirl 布局:

我假设您拥有 3.0 版的 AdWhirl SDK。您可以简单地通过普通的 XML 布局文件创建布局,而不是通过代码创建布局。不要像他们的说明所建议的那样使用 LinearLayout (我认为它已经过时了)。相反,只需将此元素放置在布局中您想要横幅的位置即可:

    <com.adwhirl.AdWhirlLayout
         android:layout_width="fill_parent"
         android:layout_height="wrap_content" />

说真的,就是这样。确保您的 AdWhirl 密钥也在清单中(在 标记内):

    <meta-data android:value="Your Key"
         android:name="ADWHIRL_KEY"/>

如果您确实需要以编程方式执行任何操作,可以像往常一样为布局指定一个 id 并使用 findViewById。让我知道这是否有帮助。

It looks like you set your LinearLayout height to 0dp: android:layout_height="0dp"
This would cause your View to not show. Try changing it to wrap_content instead. If that doesn't work there is actually an easier way to create the AdWhirl layout:

I'm assuming you have version 3.0 of the AdWhirl SDK. Instead of creating the layout through code you can simply create it through your normal XML layout file. Don't use the LinearLayout like their instructions suggest (I think it's outdated). Instead just place this element in your layout wherever you want the banner to be:

    <com.adwhirl.AdWhirlLayout
         android:layout_width="fill_parent"
         android:layout_height="wrap_content" />

Seriously, that's it. Be sure your AdWhirl key is in the Manifest as well (either within the <activity> or <application> tag):

    <meta-data android:value="Your Key"
         android:name="ADWHIRL_KEY"/>

If you really need to do anything programmatically you can give the layout an id as usual and use findViewById. Lemme know if this helps.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文