coder_For_Life22
coder_For_Life22

Reputation: 26971

Admob test ads being ignored, real ads being showed only

I am using this to get test ads VIA Admob in eclipse

  try{  
     AdRequest request = new AdRequest();
    request.addTestDevice(AdRequest.TEST_EMULATOR);
    request.addTestDevice(DEVICEID);    // My T-Mobile G1 test phone
    LinearLayout layout = (LinearLayout) findViewById(R.id.layout_main);    
    AdWhirlLayout adWhirlLayout = new AdWhirlLayout(this, "APP_ID");
    RelativeLayout.LayoutParams adWhirlLayoutParams =
    new RelativeLayout.LayoutParams(
    LayoutParams.FILL_PARENT,
    LayoutParams.WRAP_CONTENT);
    layout.addView(adWhirlLayout, adWhirlLayoutParams);
    layout.invalidate();


    }

Does anyone have any idea of what i am doing wrong?

Upvotes: 0

Views: 975

Answers (1)

Eric Leichtenschlag
Eric Leichtenschlag

Reputation: 8931

Calling request.addTestDevice is the way to get AdMob test ads when using the Google AdMob Ads SDK directly. But in this example it looks like you are trying to get AdMob Test Ads through AdWhirl. To get test ads in AdWhirl, do this instead:

 AdWhirlTargeting.setTestMode(true);

Note that the above will currently only work for the emulator. AdWhirl currently does not have the functionality to set a specific device for test mode.

Upvotes: 3

Related Questions