我已经在我的项目中集成了AdWhirl,我现在只想显示Admob.
但是只显示了一个广告...没有其他广告即将推出....在LogCat中,它是30秒后的刷新广告,但它们不会显示在屏幕上.
我使用与AdWhirl官方网站相同的编码.
请告诉我如何做到这一点......我非常迫切需要它.
<LinearLayout
android:id="@+id/layout_main"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:layout_marginBottom="5dp"
android:orientation="vertical" >
<TextView
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:text="" />
<com.adwhirl.AdWhirlLayout
android:id="@+id/adwhirl_layout"
android:layout_width="fill_parent"
android:layout_height="wrap_content" />
</LinearLayout>
Run Code Online (Sandbox Code Playgroud)
这是我的主要课程:
try
{
AdWhirlManager.setConfigExpireTimeout(1000 * 60 * 5);
AdWhirlTargeting.setAge(23);
// AdWhirlTargeting.setGender(AdWhirlTargeting.Gender.MALE);
// AdWhirlTargeting.setKeywords("online games gaming");
// AdWhirlTargeting.setPostalCode("94123");
AdWhirlTargeting.setTestMode(false);
AdWhirlLayout adWhirlLayout = (AdWhirlLayout) findViewById(R.id.adwhirl_layout);
// TextView textView = new TextView(this);
RelativeLayout.LayoutParams layoutParams = new RelativeLayout.LayoutParams(LayoutParams.MATCH_PARENT, LayoutParams.MATCH_PARENT);
int diWidth = 320;
int diHeight = 52;
int density = (int) getResources().getDisplayMetrics().density;
adWhirlLayout.setAdWhirlInterface(this);
adWhirlLayout.setMaxWidth((int) (diWidth * density));
adWhirlLayout.setMaxHeight((int) (diHeight * density));
layoutParams.addRule(RelativeLayout.CENTER_HORIZONTAL);
// textView.setText("");
LinearLayout layout = (LinearLayout) findViewById(R.id.layout_main);
layout.setGravity(Gravity.CENTER_HORIZONTAL);
layout.addView(adWhirlLayout, layoutParams);
// layout.addView(textView, layoutParams);
// layout.invalidate();
}
catch (Exception e)
{
Log.e("error", e.toString());
}
Run Code Online (Sandbox Code Playgroud)
编辑:
我之前忘记添加问题.
这是我的manifest.xml文件
<meta-data
android:name="ADWHIRL_KEY"
android:value="My_KEY" />
Run Code Online (Sandbox Code Playgroud)
| 归档时间: |
|
| 查看次数: |
412 次 |
| 最近记录: |