如何使用AdWhirl与不支持的广告公司? [英] How to use AdWhirl with an unsupported ad company?

查看:136
本文介绍了如何使用AdWhirl与不支持的广告公司?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

有谁知道AdWhirl是如何工作的?

Does anyone know how AdWhirl works?

设置我的自定义事件的Greystripe中,我初始化SDK,如果它是不是已经初始化,并刷新BannerView,但我没有看到自定义事件获取调用。所以我的主要问题是,如何以及何时AdWhirl调用自定义事件?什么是口粮和翻车?我还没有对他们的任何东西(主要是因为我不知道为什么我需要他们。这是什么AdWhirl与他们无关?)

I set up my custom event for Greystripe in which I initialize the SDK if it wasn't already initialized, and refresh the BannerView, but I don't see the custom event getting called. So my main question is, how and when does AdWhirl call the custom event? What are the rations and rollovers? I haven't done anything with them (mainly because I don't know why I need them. What does AdWhirl do with them?)

另外,我怎么控制何时AdWhirl刷新我的旗帜?我想扳平刷新一个按钮动作。

Also, how do I control when AdWhirl refreshes my banner? I'd like to tie the refresh with a button action.

我一直在寻找在网上不停在过去的两天,阅读了大量的教程和例子Java类人共享,但他们都没有工作。它只是看起来像AdWhirl是停滞不前。它是如此我不清楚AdWhirl是如何工作的超越:它介导的应用程序,所有你想要在你的广告中使用的广告机会之间。这是一个完全过高层次的理解,让我继续前进。 :(

I've been searching online nonstop for the past two days and read a lot of tutorials and example Java classes that people have shared, but none of them have worked. It just looks like AdWhirl is stagnate. It's so unclear to me how AdWhirl works beyond: it mediates between the app and all the ad opportunities you want to use in your ad. That's an entirely too high-level understanding for me to move forward. :(

推荐答案

你有没有看过的维基页面介绍如何使用自定义事件?你基本上建立在后台UI其行为类似于另一家网络广告自定义事件,并且可以配置它的流量。然后你就可以实现你在后台命名的函数名。唯一的直观的是,你必须执行AdWhirlInterface监听自定义事件,这意味着创建一个adWhirlGeneric()方法。这种方法可以是空的,虽然,我没有看到创造我自己的测试事件时调用。最后,一​​定要设置AdWhirlInterface。

Have you read the wiki page that describes how to use Custom Events? You basically create a custom event in the backend UI which behaves like another ad network, and you can configure it's traffic. Then you can implement the function name that you named in the backend. The only unintuitive part is that you have to implement AdWhirlInterface to listen for the custom event, which means creating an adWhirlGeneric() method. This method can be empty though, I am not seeing it called when creating my own test event. Finally, make sure to set the AdWhirlInterface.

因此​​,假设在后台创建与网络:

So assuming on the backend you created a network with:

    Name: Test Network
    Function Name: testEvent

和给它的流量(测试时,我建议给它100%的流量),那么你的code会是这个样子:

and gave it traffic (I recommend giving it 100% traffic when testing), then your code would look something like this:

public class MyActivity extends Activity {
...
  public void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    setContentView(R.layout.main);
    ...
  }
  ...

  public void testEvent() {
    // Place event code here.
    Log.d("Cust_Network", "Cust network got called!");
  }
}

要控制刷新您的广告,呼吁AdWhirlLayout rotateThreadedNow()被点击时一个按钮,例如。这将需要AdWhirl通过随机确定新的广告网络,并调用正确的适配器,或自定义事件在此情况下的过程。如果你选择走这条路线,你可能不希望自动刷新,在这种情况下,你应该禁止在后端自动刷新。

To control refreshing your ad, call rotateThreadedNow() on the AdWhirlLayout when a button is clicked, for example. This will take AdWhirl through the process of randomly determining a new ad network, and calling the correct adapter, or custom event in this case. If you choose to go this route, you may not want automatic refreshing, in which case you should disable automatic refreshing on the back end.

配给对象填充了配置数据。每个配给重新presents广告网络,并具有重新present各个广告网络ID,您在后端设置重量百分比,并回填优先键。回填重点是网络秩序AdWhirl将从如果原始请求没有填写要求。历尽回填优先这一过程被称为翻转。您需要了解侧翻一点点实现自己的自定义事件时。

The ration object is populated with data from the configuration data. Each ration represents an ad network, and has keys which represent the individual ad network ids, weight percentages that you set in the backend, and backfill priority. Backfill priority is the network order that AdWhirl will request from if the original request did not fill. This process of going through backfill priority is called rollover. You will need to know a little bit about rollover when implementing your own custom event.

中提到的维基页面有这些建议添加到您的自定义事件:

The wiki page mentioned has these recommendations to add to your custom event:

    //  In your custom event code, you'll want to call some of the below methods.
    //
    //  On success:
    //  this.adWhirlLayout.adWhirlManager.resetRollover();
    //  this.adWhirlLayout.rotateThreadedDelayed();
    //
    //  On failure:
    //  this.adWhirlLayout.rolloverThreaded();

如果您的自定义事件妥善取一个广告,你将要重置的翻转顺序(所以接下来的请求将有正确的回填顺序),并调用rotateThreadedDelayed(),这样刷新将在所需的时间自动发生您在后端规定。如果广告请求失败,你将要调用rolloverThreaded(),这样AdWhirl可以通过它的过渡过程中,检查您的其他配置广告网络的广告。

If your custom event properly fetches an ad, you will want to reset the rollover order (so the next request will have the correct backfill order), and call rotateThreadedDelayed() so that a refresh will happen automatically in the amount of time you specified on the back end. If the ad request failed, you will want to call rolloverThreaded() so that AdWhirl can go through it's rollover process to check your other configured ad networks for ads.

这篇关于如何使用AdWhirl与不支持的广告公司?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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