2012-07-12 94 views
5

我已將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" /> 
+0

廣告庫存中可能沒有廣告。 – 2012-07-12 09:01:55

+0

你是在Real設備上還是在仿真器上運行? – 2012-07-12 09:03:11

+0

@Algo ...具有相同密鑰的相同adhwirl ID正在處理Iphone應用程序並正確顯示廣告。 是的,我在真正的設備夥伴上測試它 – Noman 2012-07-12 09:28:26

回答

1

你缺少的AdWhirl關鍵在你的Android清單

確保您的AdWhirl關鍵是在清單以及(或者<activity>,或<application>標籤內) :

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

它看起來像你根本沒有得到所有網絡的任何庫存(廣告)。你確定你在AdWhirl控制面板中正確設置了它們嗎?

查看這些instructions添加您的APP並註冊廣告網絡。您還必須爲每個廣告網絡製作一個帳戶。

也請檢查網絡庫它們是否正確安裝?

+0

我已經在我的manifest.xml中添加了具有適當鍵的元數據標籤 – Noman 2012-07-12 09:30:07