5

I have integrated AdWhirl in my project and i want to display only Admob right now.
But only one ad is shown...no other ads are coming....in LogCat it is refreshing ads after 30 seconds but they are not shown on the screen.
I am using the same coding as on the official website of the AdWhirl.
Please tell me how i can do this... I need it very urgent.

  <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> 

And this is in my Main Class:

    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());
    }    

EDIT:
I forgot to add in the question earlier.
This is my manifest.xml file

<meta-data
        android:name="ADWHIRL_KEY"
        android:value="My_KEY" />
Noman
  • 4,049
  • 10
  • 38
  • 59

0 Answers0