Adrotator Questions

Jan 9, 2014 at 11:42 PM
Edited Jan 9, 2014 at 11:45 PM
Hello,
I have few questions about adrotator:
1) visual studio designer expects all the id to be populated in the XAML code. If not my designer is not loaded. Should I need to populate all the Ids in the XAML for adrotator to work?
An Exception was thrown.
NullReferenceException: Object reference not set to an instance of an object.
StackTrace
at AdRotator.AdRotatorControl.GetAppID(AdType adType)
at AdRotator.AdRotatorControl.get_AdDuplexAppId()
InnerException: None


2) Here is my XAML and XML. For me it only displays pubcenter ads or nothing.
<adRotator:AdRotatorControl  x:Name="AdRotator"
                AdHeight="80"
                AdWidth="480"
                DefaultSettingsFileUri="/PhoneApp1;component/defaultAdSettings.xml"
                SettingsUrl="http://mysite.com/AdSettings.xml">
            </adRotator:AdRotatorControl>
XML:
<?xml version="1.0" encoding="utf-8"?>
<AdSettings xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema">
  <CultureDescriptors>
    <AdCultureDescriptor CultureName="en-US">
      <Probabilities Probability="20" AdType="AdMob" AppID="ca-app-pub-5143926332673743/4108918912"/>
      <Probabilities Probability="10" AdType="MobFox" AppID="1aaa8b268300463aa227853cd6e99cb7" IsTest="false"/>
      <Probabilities Probability="70" AdType="PubCenter" AppID="f9018b1a-6932-4d4a-867d-5f90b47351a2" SecondaryID="149542" />
    </AdCultureDescriptor>
    <AdCultureDescriptor CultureName="en-IN">
      <Probabilities Probability="70" AdType="AdMob" AppID="ca-app-pub-5143926332673743/4108918912"/>
      <Probabilities Probability="25" AdType="MobFox" AppID="1aaa8b268300463aa227853cd6e99cb7" IsTest="false"/>
      <Probabilities Probability="5" AdType="PubCenter" AppID="f9018b1a-6932-4d4a-867d-5f90b47351a2" SecondaryID="149542" />
    </AdCultureDescriptor>
    <AdCultureDescriptor CultureName="default">
      <Probabilities Probability="50" AdType="AdMob" AppID="ca-app-pub-5143926332673743/4108918912"/>
      <Probabilities Probability="25" AdType="MobFox" AppID="1aaa8b268300463aa227853cd6e99cb7" IsTest="false"/>
      <Probabilities Probability="25" AdType="PubCenter" AppID="f9018b1a-6932-4d4a-867d-5f90b47351a2" SecondaryID="149542" />
    </AdCultureDescriptor>
  </CultureDescriptors>
</AdSettings>
Am I doing anything wrong? Whatever the probability I give AdMob ads are never displayed through adrotator. But they are displaying fine when used without adrotator. And I am calling Invalidate() in Page_Loaded.

Can someone please help?
Jan 10, 2014 at 4:48 PM
That is a very strange error but shouldn't cause an exception like that, it's checking for an AdDuplexID which you don't have configured (or it is in one of the config XML files)

As for AdMob, you should check the version of the control you are using against the platform, although you state that you are getting ads from admob without adrotator using the same config, so unsure why you wouldn't get them otherwise as they are called the same way internally.

You could try using the new V2 control which has now reached Beta stage and create a new config file with your settings (the schema has changed slightly)

Hope this helps.
Marked as answer by sistla001 on 1/12/2014 at 3:44 PM
Jan 12, 2014 at 11:27 PM
Edited Jan 13, 2014 at 12:52 AM
Thanks for your reply. I have updated my project to new V2 and now works perfectly.
few more questions?
1) I see something called adgroup, What is it?
2) With new adrotator V2 I am NOT calling Invalidate() as it expects a adprovider as a parameter. Is it necessary to call Invalidate method with new V2?
3) How to define Size of the adrotator? I want to show an 300 x 50 ad. Is is possible with ad rotator? I tried to set AdHeight, Ad Width, Width and Height properties. But just shows part of the ad with that width and height. (May be it is getting trimmed)
Jan 13, 2014 at 9:16 AM
Please direct V2 questions to the V2 site so as not to confuse the two.

AdGroup is a new feature which isn't fully implemented as yet in V2, the intention is to be able to group ads together in a certain order for selection, most likely for HouseAds where you need to tailor your own ads for display in with paying ads.

You don't have to call invalidate in V2, you can just use the AutoStartAds parameter in XAML to automatically start it. You can still call invalidate with either a null parameter to get the next probably ad or specify an adtype to request that provider explicitly (will fall back to the next probable if that fails)

V2 does use AdHeight and AdWidth as part of the request to the provider, if you ad is getting clipped check the container you are placing the ad in or if you have set a different height and width for the adrotator control.