我已將AdWhirl集成到我的項目中,並且我現在只想顯示Admob。
但是隻顯示了一個廣告......沒有其他廣告來了......在LogCat中,它是在30秒後刷新廣告,但它們沒有顯示在屏幕上。
我使用的是AdWhirl官方網站上的相同編碼。
請告訴我如何做到這一點......我需要它非常緊迫。AdWhirl未展示AdMob廣告
<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>
這是我的主類:
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());
}
編輯:
我忘了在質詢時添加。
這是我的manifest.xml文件
<meta-data
android:name="ADWHIRL_KEY"
android:value="My_KEY" />
廣告庫存中可能沒有廣告。 – 2012-07-12 09:01:55
你是在Real設備上還是在仿真器上運行? – 2012-07-12 09:03:11
@Algo ...具有相同密鑰的相同adhwirl ID正在處理Iphone應用程序並正確顯示廣告。 是的,我在真正的設備夥伴上測試它 – Noman 2012-07-12 09:28:26