After spending just a couple of days looking at Windows Phone development for the first time, I thought it worthwhile to record my findings as it could be useful for other developers now making the transition to the new platform.
The installation of the Windows Phone tools is relatively simple although you need Vista or Windows 7 for the install to work. Once installed you end up with Microsoft Visual Studio 2010 Express. Also download the WP7 Training kit offline, this is a tutorial which takes you creating your first application. It’s also worth watching a few of the videos (watch these ones on this page step 3 as some of the other introductory videos are decidelly poor) which explain development.
Once you’re up and running with Visual Studio you can create your first app. You actually have 2 main choices at this point, you can either create an XNA app (if your app is going to be a game) or a SilverLight app if it’s a page based app. In my case I wanted to create a page based app; you can follow the tutorial so I want go into the details here, but there is also a tool called Expression which allows the UIs to be designed graphically. Either way you end up with an XML definition of the UI and at the same time you can see what it will look like on the screen. Once you’re coded up you hit debug and the Windows Phone 7 Emulator runs and you can interact with your app, set break points and inspect data values. All these tools are absolutely first class quality and completely faultess as far as I can see, so that’s all great news.
Now the next thing is what to do with the apps and here it gets more complicated, control is more similar to iPhone’s approach to treating apps. Apps are a bit more controlled than with today’s Nokia phones. Apps can only be downloaded from Microsoft’s own appstore called App Hub and no where else, not even operator appstores it seems (correct me if I am wrong someone). As a developer you can declare your phones as a development device and install your own apps on it. You can also email the apps to people who have also declared their phones to be development phones and there is a tool called Application Deployment to install them on their phones but no other distribution approach is allowed.
So you have to sign up to AppHub in order to distribute your apps. It costs $99 (£65) per year to join (free for students) and you then there are some further rules. You can only have 5 free apps per year per developer but as many paid for apps as you want. There’s the usual QA of course and as yet I don’t know how painful that is. Apparently sign up involves being given a Verisign certificate and this involves having to let Verisign phone you up and sending them a scan of your passport etc. I’ve been through similar things with some other appstores. Then finally in order to get paid you have to submit a W8-Ben form (although there is no hurry for this as it’s not needed until you’ve actually earnt some money) if you are not an American and don’t want the US Govt to withhold 30% of your income as tax. This is a complete pain as this form requires you to get either an EIN (enterprise identity number if you are a company) or an ITIN (if you’re an individual). I’ve been through this pain already for a different appstore but getting the EIN for my company cost me £300 (inc VAT) and several weeks, so be warned. There are only 2 companies in the UK who can get you the EIN or ITIN so also quite involved.
OK so what’s the phone like and what’s it like to write code? Well, it’s really very easy to create great looking apps. I have two issues but I’ve heard both of these will be fixed before the end of the year. Firstly Apps are subject to single tasking OS today, anything that happens eg a phone call or even screen lock and the app is closed and you have to code the saving of state (similar to what you have to do with the iPhone and Samsung Bada) and then of course when the app is resumed you have to code the loading of the state info to resume where you left off. The other issue I had was the browser only supports HTML4 and CSS2.1. So today I watched Steve Balmer’s key note at Barcelona and he announced both issues will be resolved before the year is out (as if he was reading my mind). There will be an upgrade which allow multitasking (I suspect the suspend and resume functionality may still be required though) and they will be supporting HTML5 too and I suspect it will be a subset of CSS3 too. The goiod news though is they said the IE9 engine going on Mobile is code identical with the desktop version (whether this is really true I’ll wait to see of course because I wonder how they deal with the scrolling issues that Apple Safari and Android Chrome treat very differently.
Overall the new world of Microsoft tools is a very smooth process just a shame about the additional expenses of a new appstore to deal with.
