Making a Windows Phone weather app in an hour

TwitterFacebookRedditGoogle+EmailPinterest

TechEd Africa 2013 ended a few days ago in Durban, South Africa.

I did a couple of talks – one of which was an hour-long session where I guided the attendees through the process of creating a good-looking weather app for Windows Phone. There are no shortage of weather apps in the marketplace, but it was a nice example to bring in a lot of different real-world situations like consuming JSON, using MVVM, and lots of binding stuff.

The point was to show how easy it is to create an app quickly. It only took 20 lines of code and 60 lines of XAML (half of which are closing tags so don’t count). The app would take around 15 minutes to make if I weren’t explaining.

BIJvreECYAIWiDb

After the session a number of people asked me if I would post-record the talk and upload it. So below is the full source code, along with the talk which I uploaded to YouTube.

weatherapp

A few things to note:

  • I’m still tired from TechEd, so I do lose my train of thought every now and then ;-) (but I did manage to record the whole video first time and in one go!)
  • I kept the talk the same as the one I did for them, which means that it does not go vastly into detail about every topic (not enough time).
  • Because of time, there are many things missing. The obvious one is that the location is hard-coded in. But there are smaller problems like the light-theme not being supported properly.
  • There isn’t really any error handling.

If there is interest I will flesh-out the solution a bit to make it a marketplace-worthy app and post the source of that.

Source code: Click me (~4MB)

Video:

TwitterFacebookRedditGoogle+EmailPinterest
  • http://www.facebook.com/ivissie Vissie Schalekamp

    Wow, epic tut. Great entry demo app. Would love to try this out!!

  • http://gordonbeeming.azurewebsites.net/ Gordon Beeming

    Nice Tutorial dude,

  • Frantzdy romain

    Loved this tutorial. I am a new to windows phone Wanted to Grab the user’s current location is it ideal to do that in the viewmodel and ask for permisson after applicaton initialization

    • RogueCode

      I would recommend defaulting to somewhere like New York, and then asking for permission. Only after they give permission, then get their location.
      But yes, stick that all in the ViewModel (except maybe the prompts – depending on how strictly you want to follow MVVM).

      • Frantzdy romain

        Awesome! Thanks.

  • http://twitter.com/riaandelange Riaan de Lange 

    nice

  • Matt

    For VS 2013 you need to download mvvm light from codeplex http://mvvmlight.codeplex.com/ to get the snippets to appear.