One awesome detail that iPhone and Android developers have always enjoyed was the ability to make some extra money by including ads in their free applications. In fact, I took advantage of it several times, most notably in That’s Not Funny for the Android and it’s port to the iPhone.  In the scheme of things, it’s not a lot of money, but it pays for my daughter’s crippling Hello Kitty addiction.

So recently, I thought it would be cool to port this app to the newly minted Windows Phone 7.  The coding was straight forward enough.  But the ability to monetize is simply not there on the WP7 – there are noises that eventually Bing Ads toolkit will come to the phone, but nothing has materialized yet.  At the same time, none of the big mobile players, such as AdMob (now Google) or Quattro Wireless (now Apple) have released anything for the platform. 

Seeing how I used AdMob on both Android and the iPhone platforms, I set out to build a custom control that the WP7 developers can simply drop into their forms and it would just magically make them money.

The bottom line is this: I posted the results of this initial effort on CodePlex.  Plus, I created a video that walks you through the process of embedding ads.

The development revealed a couple of things about the Windows Phone 7 SDK: it’s a typical 1.0 release – the APIs are somewhat incomplete.  For instance:

  • Browser User Agent.  AdMob requires this information, but WP7 provides no way to get it.  I had to implement a nasty hack, where I would spin up a WebBrowser control, load a bit of JavaScript into the web page and have it spit out the User Agent back to me via Browser to OS interop. 
  • IP Address.  AdMob requires an external IP Address.  WP7 has no way of finding it.  In this case, I actually had to create a web page,  that detects the IP address server side and responds with it via JSON.

But all in all, a very pleasant development experience.  My familiarity with Silverlight definitely helped.  I would even say that a passing knowledge of this technology is absolutely required.  If you do not have Visual Studio 2010 installed on your box, the setup will provide you with a WinPhone7 only version of VS2010.  And if you do have it, then it’ll integrate the tools into your existing install.  I wish this was an option, as the WinPhone7 only version of  VS2010 is markedly snappier. 

I feel like version 2 of Windows Phone 7 SDK is going to patch all the holes left by v1 and will turn out to be be fantastic.

For reference: That’s Not Funny.

Android

Windows Phone 7

 
NotFunnyAndroid AdMobOnWinPhone7