DZone
Mobile Zone
Thanks for visiting DZone today,
Edit Profile
  • Manage Email Subscriptions
  • How to Post to DZone
  • Article Submission Guidelines
Sign Out View Profile
  • Post an Article
  • Manage My Drafts
Over 2 million developers have joined DZone.
Log In / Join
  • Refcardz
  • Trend Reports
  • Webinars
  • Zones
  • |
    • Agile
    • AI
    • Big Data
    • Cloud
    • Database
    • DevOps
    • Integration
    • IoT
    • Java
    • Microservices
    • Open Source
    • Performance
    • Security
    • Web Dev
DZone > Mobile Zone > Making the MS Adcontrol REALLY work on phone 7

Making the MS Adcontrol REALLY work on phone 7

David Kelley user avatar by
David Kelley
·
Apr. 25, 11 · Mobile Zone · News
Like (0)
Save
Tweet
5.40K Views

Join the DZone community and get the full member experience.

Join For Free
So you want to use ad's in your windows phone 7 apps as a revenue stream and you followed the directions and it seems like it 'may' work but alas everyone that that has your app never see's an ad and come to think of it you haven't either save the test add...? Hmmm...

You went out to this site:

https://pubcenter.microsoft.com/Login

and created an 'ad unit' and gotten an application id for your app.

you then have downloaded the phone 7 ad SDK from this link

http://advertising.microsoft.com/mobile-apps

included and referenced the ad DLL and created the xaml that looks to the effect of :

(at the top of your xaml)
xmlns:advert="clr-namespace:Microsoft.Advertising.Mobile.UI;assembly=Microsoft.Advertising.Mobile.UI"

(some where on the page)
<advert:AdControl x:Name="AdvertControl"
ApplicationId="[Guid here]" AdUnitId="[ad unit id here]"
AdModel="Contextual"
RotationEnabled="True" Width="480" Height="80"
Margin="0,-1,0,0" UseLayoutRounding="False" VerticalAlignment="Top" d:LayoutRounding="Auto"
d:LayoutOverrides="Height" >
</advert:AdControl>

you've compiled and uploaded and even went so far as to test your app using the test values they provide for the application id and ad unit id... your app is approved but your not getting any hits...

hmm... what you have over looked... oops they left out one tiny detail... at least in all the directions I have found... in your constructor or in our override onnavigateto try adding this little bit of C#...

AdControl.TestMode = false;


really? as much as it makes me tired all over... yes this is all the magic I needed todo...
app ADS (motorcycle) Windows Phone application Testing Software development kit Stream (computing) Links

Published at DZone with permission of David Kelley. See the original article here.

Opinions expressed by DZone contributors are their own.

Popular on DZone

  • What SREs Can Learn From the Atlassian Nightmare Outage of 2022
  • Use Lambda Function URL To Write a Serverless App Backed by DynamoDB
  • Why Is Software Integration Important for Business?
  • How Database B-Tree Indexing Works

Comments

Mobile Partner Resources

X

ABOUT US

  • About DZone
  • Send feedback
  • Careers
  • Sitemap

ADVERTISE

  • Advertise with DZone

CONTRIBUTE ON DZONE

  • Article Submission Guidelines
  • MVB Program
  • Become a Contributor
  • Visit the Writers' Zone

LEGAL

  • Terms of Service
  • Privacy Policy

CONTACT US

  • 600 Park Offices Drive
  • Suite 300
  • Durham, NC 27709
  • support@dzone.com
  • +1 (919) 678-0300

Let's be friends:

DZone.com is powered by 

AnswerHub logo