我在我的应用程序中实现 OpenX 时遇到问题。这就是我设置 OXMAdController 的方式:
protected void onCreate(Bundle savedInstanceState)
{
super.onCreate(savedInstanceState);
//OpenX init (needs to be called before setContentView method)
OXMManagersResolver.getInstance().prepare(this);
setContentView(R.layout.category_pager);
//Setting OpenX
try
{
mAdController = new OXMAdController(this, "ads.domain.com");
}
catch (OXMAndroidSDKVersionNotSupported e)
{
e.printStackTrace();
}
mAdController.setAdControllerEventsListener(new OXMAdControllerEventsListener()
{
@Override
public void adControllerWillLoadAd(OXMAdBaseController arg0)
{
Log.v("test", "adControllerWillLoadAd");
}
@Override
public void adControllerDidLoadAd(OXMAdBaseController arg0)
{
Log.v("test", "adControllerDidLoadAd");
}
@Override
public void adControllerDidFailWithNonCriticalError(OXMAdBaseController arg0, OXMError arg1)
{
Log.v("test", "adControllerDidLoadAd");
}
@Override
public void adControllerDidFailToReceiveAdWithError(OXMAdBaseController arg0, Throwable arg1)
{
Log.v("test", "adControllerDidFailToReceiveAdWithError");
}
@Override
public void adControllerActionUnableToBegin(OXMAdBaseController arg0)
{
Log.v("test", "adControllerActionUnableToBegin");
}
@Override
public boolean adControllerActionShouldBegin(OXMAdBaseController arg0, boolean arg1)
{
Log.v("test", "adControllerActionShouldBegin");
return true;
}
@Override
public void adControllerActionDidFinish(OXMAdBaseController arg0)
{
Log.v("test", "adControllerActionDidFinish");
}
});
mAdController.initForAdUnitIds(43, 43);
mAdController.startLoading();
}
服务器返回回调方法adControllerDidFailToReceiveAdWithError
两次。第一次错误是com.openx.ad.mobile.sdk.errors.OXMServerWrongStatusCode: Server returned 404 status code
,第二次错误是com.openx.ad.mobile.sdk.errors.OXMServerWrongResponse: Server response parsing error.
有谁知道为什么会这样?