MSDN UK Team blog

Get all the latest Microsoft developer news, tools, downloads, tutorials and tips right here, every day.
Search Form
Unfiltered HTML
Developers code with microsoft

Guest Post: Behind the scenes with Windows 8 Application Development – A developers perspective

Unfiltered HTML
Unfiltered HTML

Guest Post: Behind the scenes with Windows 8 Application Development – A developers perspective

  • Comments 1

 

By Richard Garside

My first real look at Windows 8 and developing for Windows 8 was at a roadshow in Manchester back in April 2012. It was a bit of a whirlwind tour but I was impressed. Windows 8 looked slick and as a seasoned .NET developer I was excited to have a new platform to program on that would make use of my existing skills, but also challenge me. I also had an app idea.

The next morning I was installing the beta bits on a virtual machine and was eager to get started.

There was a lot of talk at the roadshow about the choice between C# XAML and JavaScript HTML. I love C# and I tolerate JavaScript so this was not a difficult decision for me. However I’d not done any XAML development before, so there was lots to learn.

In the run up to the launch of Windows 8 Microsoft had obviously been working overtime on providing materials to help developers get started.

There’s nothing like just seeing the code and the Store Code Samples provided covered virtually everything you’d ever want to do. The online WinRT documentation was also very useful and easy to browse through to find what you needed.

Samples and documentation are great when you know the basics and you need to find something specific, but not so great when you’re starting out. I found the Windows Store Roadmap had some great quickstart guides in it that were really useful. Sometimes it’s good to have a book though. A book can take you on a journey from beginner to expert in a guided way that’s hard to duplicate by picking and choosing from what’s on the web.

Luckily for me Charles Petzold released his book Programming Windows on an early release program. It’s finished now, but even in its first draft state with most of the chapters not written yet it was an excellent guide to Windows 8 development. I think it may even have been slightly better for being shorter. There’s something quite nice about a computer book you can actually finish, although it does cover a lot more topics now.

We all learn in different ways. I learn best by doing and I like to do things in my own time. That’s why books and samples serve me well. Sometimes it’s nice to be shown and there were lots of dev camps running across the world with experts at hand to teach and talk you through stuff. I didn’t go to any of these, partly because they were booked up, but mainly because I felt I had all I needed with my book and the samples to make my app.

My app is imaginatively called Font Picker and is for designers who need to choose fonts for their projects. While dabbling in design I’d been frustrated by the inexplicably small sample writing on the font drop down boxes in most graphic design packages. I also wanted a way to save lists of fonts to come back to later. My app Font Picker would solve all these problems (and hopefully more in v2).

One of the first things my app needed to do was get a list of fonts on the user’s computer. This turned out to be harder than I expected. The WinRT API lets you do most things you would ever want to, but sometimes you need to fall back to C++. I was surprised to find that getting a list of installed fonts was not included in the WinRT API. Hopefully this will get added in the future, but till then interoperating with a C++ WinRT Component was suspiciously straight forward. Particularly when compared to my previous horrible experiences of interop.

Once I had a working version of Font Picker I needed to sort out the design. At the Windows 8 Workshop I’d been very inspired by the talk by Andrew Spooner on app design. I’d decided to base my colour scheme on the Windows 8 Financial App. My first attempt did not look as slick as I’d hoped, in fact it looked rubbish. XAML gives you so much control over design and so many choices that it is easier to make a bad UI than it is to make a good one. It took me several iterations of twiddling with margins and trying different colour schemes till I had something I was happy with.

Now, I had a working app, but the store was not yet open. However there was an early access scheme. All I needed to was take part in an App Lab and suitably impress a Microsoft Windows Expert. This was exciting for several reasons. Firstly I’d get to go Microsoft’s Reading Campus and as a nosey person I was thrilled about this. More usefully I’d get several hours of help from an expert in Windows 8 and there were still a few things niggling me that I wanted to sort out.

It turned out I had more problems than I thought. The first thing we did was test Font Picker on a tablet and it crashed within seconds, which was just a little bit embarrassing. I found out later that this was a memory problem caused by using a layout panel that didn’t virtualise its contents. This memory problem was nicely hidden by my powerful dev machine, so we did the rest of the testing on that. I passed most of the other tests, but I would need to fix my crashing problem. They also wanted me to improve the design and had several suggestions on how to do that. Once that was sorted, I just needed to get retested.

I’d attended one of the first App Labs. By the time I’d fixed my problem and got to the top of the waiting list I was in the final set of them before launch. This time I chose to do the whole thing online, which saved me a lot of travelling time.

I expected to pass with flying colours as I’d done everything suggested, and I almost did, but they dropped a Columbo like ‘just one more thing’ on me.

They wanted the early access apps to show off the features of Windows 8 to the full. When you show long lists of things like fonts in my case, a Windows 8 App should have semantic zoom. So, I just needed to add that and then I would get my early access token.

This turned out to be more difficult in my case than it sounded. To keep the layout I wanted and not lose the layout panel virtualisation that kept my app from crashing on tablets I would need to do more than just follow the standard semantic zoom example. This took a lot of research and experimenting. I was so pleased once I finally solved this problem that I wrote a blog post about my solution.

With this problem solved I was finally ready for access to the store. Unfortunately the delay meant I’d missed early access programme and got into the store with the first set of developers getting ready for general release.

I’m a big fan of the Minimum Viable Product. Build the minimum feature set that will allow you to prove that an idea works and it solves a real problem in a way that people like. The App Labs forced me to go beyond that and make better use of Windows 8 features than I would have done in this first version. It’s a better app for it, and I massively appreciate the time taken to help me. I think it’s largely due to this help that Font Picker was a top ten prize winner at The Creative Bloq App Contest.

Getting into the store in time for the release of Windows 8 was great, but there was a rush of other developers doing the same and the delay in getting through store certification was a bit painful. I also learnt an important, but painful lesson. Make sure you un-tick any capabilities you’re not using in the app manifest. I was not using the Internet Connection, but the app manifest said I was. So I failed because I hadn’t included a privacy policy saying why I was using the Internet connection. I un-ticked the box, resubmitted and passed. Jennifer Marsman has written about the privacy policy requirement and other common reasons for failing store certification.

Win8-Balmer_04Another highlight of this for me was getting to see Steve Ballmer speak at an event at Modern Jago for Windows 8 developers. I’m normally quite sceptical of such things, but I got totally caught up in his enthusiasm. I’ve also met a lot of great developers at the events who I’ve kept in touch with through twitter. They’ve been a great help and a lot of fun.

Hopefully this article has given you some good tips on how to get started. The journey from idea to finished product was not smooth, but seeing your idea realised is very rewarding. Now I just need the time to make all my other ideas and possibly v2 of Font Picker.

If you’re interested in developing for Windows 8 then I’d check out these resources that I mentioned earlier in the article:

· Windows Store Roadmap

· Programming Windows by Charles Petzold

· Store Code Samples

· WinRT documentation

Bio

RichardGarsideRichard Garside is a freelance .NET developer working mainly with .NET MVC, Orchard and Windows 8. He recently became an award winning Windows 8 developer for his app Font Picker, but he doesn’t like to boast about it. He is also a founding and managing member of Leeds Sharp, a user group for .NET developers in Leeds.

Page 1 of 1 (1 items)
Leave a Comment
  • Please add 5 and 2 and type the answer here:
  • Post