How can I use a default house ad?

Mar 25, 2014 at 3:52 PM
Edited Mar 25, 2014 at 3:53 PM
I want to use an image instead of the pubcenter ads, but my default house ad isn't appearing on my Windows Phone device screen.
Why is my image("Simpsons_Logo") not getting drawn on the screen?
What should I change?

defaultAdSettings.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="100" AdType="PubCenter" AppID="..." SecondaryID="..." /> 
      <Probabilities AdType="DefaultHouseAd" AppID="http://xna-uk.net/AdRotator/XNAHouseAdImage.png"/> 
    </AdCultureDescriptor> 
    <AdCultureDescriptor CultureName="en-GB"> 
     <Probabilities Probability="100" AdType="PubCenter" AppID="..." SecondaryID="..." /> 
      <Probabilities AdType="DefaultHouseAd" AppID="http://xna-uk.net/AdRotator/XNAHouseAdImage.png"/> 
    </AdCultureDescriptor> 
    <AdCultureDescriptor CultureName="de-DE"> 
     <Probabilities Probability="100" AdType="PubCenter" AppID="..." SecondaryID="..." /> 
      <Probabilities AdType="DefaultHouseAd" AppID="http://xna-uk.net/AdRotator/XNAHouseAdImage.png"/> 
    </AdCultureDescriptor> 
    <AdCultureDescriptor CultureName="default"> 
     <Probabilities Probability="100" AdType="PubCenter" AppID="..." SecondaryID="..." /> 
      <Probabilities AdType="DefaultHouseAd" AppID="http://xna-uk.net/AdRotator/XNAHouseAdImage.png"/> 
    </AdCultureDescriptor> 
  </CultureDescriptors> 
</AdSettings>
My code:
public class Game1 : Microsoft.Xna.Framework.Game 
    { 
        GraphicsDeviceManager graphics; 
        SpriteBatch spriteBatch; 

        public Game1() 
        { 
            Application.Current.UnhandledException += new EventHandler<ApplicationUnhandledExceptionEventArgs>(Current_UnhandledException); 
            graphics = new GraphicsDeviceManager(this); 
            Content.RootDirectory = "Content"; 
            TargetElapsedTime = TimeSpan.FromTicks(333333); 
            InactiveSleepTime = TimeSpan.FromSeconds(1); 
            graphics.PreferredBackBufferWidth = 480; 
            graphics.PreferredBackBufferHeight = 800; 

            graphics.IsFullScreen = true; 

            Window.OrientationChanged += new EventHandler<EventArgs>(Window_OrientationChanged); 
            graphics.SupportedOrientations = DisplayOrientation.Portrait | 
                DisplayOrientation.LandscapeLeft | 
                DisplayOrientation.LandscapeRight; 
        } 

        protected override void OnActivated(object sender, EventArgs args) 
        { 
            try 
            { 
                LittleWatson.CheckForPreviousException("adrotator@xna-uk.net", "AdRotator XNA Bin Example Error Report"); 
            } 
            catch { } 
            base.OnActivated(sender, args); 
        } 

        void Current_UnhandledException(object sender, ApplicationUnhandledExceptionEventArgs e) 
        { 
            if (System.Diagnostics.Debugger.IsAttached) 
            { 
                // An unhandled exception has occurred; break into the debugger 
                System.Diagnostics.Debugger.Break(); 
            } 
            else 
            { 
                try 
                { 
                    LittleWatson.ReportException((Exception)e.ExceptionObject, "AdRotator XNA Bin Error"); 
                } 
                catch { } 
            } 
        } 

        void Window_OrientationChanged(object sender, EventArgs e) 
        { 
            //switch (Window.CurrentOrientation) 
            //{ 
            //    case DisplayOrientation.Portrait: 
            //        AdRotatorXNAComponent.Current.AdPosition = new Vector2(0, 0); 
            //        break; 
            //    default: 
            //        AdRotatorXNAComponent.Current.AdPosition = new Vector2((GraphicsDevice.Viewport.Width / 2) - 240,0); 
            //        break; 
            //} 
            AdRotatorXNAComponent.Current.UpdateAdPostition(); 
        } 

        protected override void Initialize() 
        { 
            AdRotatorXNAComponent.Initialize(this); 

            //Optional Local Hard coded Ad Provider setings 

            //AdRotatorXNAComponent.Current.PubCenterAppId = "test_client"; 
            //AdRotatorXNAComponent.Current.PubCenterAdUnitId = "Image480_80"; 

            //AdRotatorXNAComponent.Current.AdDuplexAppId = "0"; 

            //AdRotatorXNAComponent.Current.InneractiveAppId = "DavideCleopadre_ClockAlarmNightLight_WP7"; 

            //AdRotatorXNAComponent.Current.MobFoxAppId = "474b65a3575dcbc261090efb2b996301"; 
            //AdRotatorXNAComponent.Current.MobFoxIsTest = true; 

            //Specify where you want the Ad to display (based on the top left corner of the Ad) 
            AdRotatorXNAComponent.Current.AdPosition = new Vector2(0, 720); 

            //Optionally specify your own House Ad which will display if there is no network 
            AdRotatorXNAComponent.Current.DefaultHouseAdImage = Content.Load<Texture2D>(@"Simpsons_Logo"); 

            //Event handler to do something should the user click on your Default House Ad 
            AdRotatorXNAComponent.Current.DefaultHouseAdClick += new AdRotatorXNAComponent.DefaultHouseAdClickEventHandler(Current_DefaultHouseAdClick); 

            //Optionally specify the slide (popup) direction for the Ad 
            AdRotatorXNAComponent.Current.SlidingAdDirection = SlideDirection.None; 

            //Optionally Set the local configuration file used to set the default Ad Locations 
            AdRotatorXNAComponent.Current.DefaultSettingsFileUri = "defaultAdSettings.xml"; 

            //Optionally set a URL from where to pull the configuration file down remotely each time the game is run 
            AdRotatorXNAComponent.Current.SettingsUrl = "http://adrotator.apphb.com/defaultAdSettingsXNALoc.xml"; 

            //Add the control to the XNA Component list which will display the ad 
            //Note as this is XNA be sure to just to this for the game states you want it shown. 
            Components.Add(AdRotatorXNAComponent.Current); 

            base.Initialize(); 
        } 

        void Current_DefaultHouseAdClick() 
        { 
            try 
            { 
                MessageBox.Show("You clicked on my Ad, thanks very much"); 
            } 
            catch { } 
        } 

        protected override void LoadContent() 
        { 
            spriteBatch = new SpriteBatch(GraphicsDevice); 

        } 

        protected override void Update(GameTime gameTime) 
        { 
    
            base.Update(gameTime); 
        } 

        protected override void Draw(GameTime gameTime) 
        { 
            GraphicsDevice.Clear(Color.CornflowerBlue); 

            base.Draw(gameTime); 
        } 
    }