Blockchains, Cloud & Development

Windows Phone

Last week, I flew around Australia helping out with the Bizspark dev camps. I answered questions that the attendees had on development on Windows Azure as well as Windows 8 and Windows Phone. I also got up front and did a mini presentation on development tips.

At the event we discussed ways that Windows Azure can help you quickly bootstrap your startup by providing a cheap way to deploy your web app to test the idea, and then scale it up once it starts to get popular. We also touched on how to build Windows 8 and Windows Phone apps that can be supported with Windows Azure Mobile services.

Below are some photos from the event The Sydney Event:

And the Melbourne event.

I really enjoy participating with the developer camps & app fests. It is a great way to get a bunch of passionate people into a room and swap stories. It is always interesting to see what personal projects people have been working on and need help with.

This month saw the first Melbourne AppFest, it all went without a hitch.
The facilities were perfect and the catering was the usual good Cliftons standard.

We had a lot of mentor support there on the day (Nick Hodge, Frank Arrigo, David Glover, Shane Morris, and a few members from the community).

There were a good number of developers there. Many of them had general development questions about Windows Phone & Windows 8, as well as a few people there interested in Windows Azure.

There was a competition on the day for the best app of the day. This was won by Lars Klint for his “Picture of the day” application. It allows you to connect to a feed (such as the National Geographic) and it will change your Window Phone’s lock screen each day.

As there was only a Sydney event being organised, I worked with the Microsoft DPE team to help organise a secondary event to be hosted in Melbourne.
The Melbourne event will be a 1 day event on Saturday 2nd March. Space is limited so you NEED to register quicklyhttp://wp.msdeveloper.com.au/Pages/Events.aspx

Post-mortem

Due to timing constraints, I was only given a week to build the entire application to ensure that we had 1.5 weeks lead time for the certification process. This meant I had to leverage as many frameworks and controls to complete it on time.

Ensuring the basics work

I started off by utilising the Windows Phone starter kit for conferences to give me a basic framework for the application. The framework was built to get the data from a custom JSON service the original author was using, however the TechEd data feed was coming from a WCF OData service. I discovered at this time that although the Windows Phone can directly consume the OData service, it only supports XML and not JSON formatted data. The size of the JSON data vs XML data was 300k vs 950k. There was not enough time to try and access the OData feed via manually constructed HTML webclient requests and manual parsing. Instead I specified in the OData LINQ query just the fields that were required for the app. This took the data payload down from 950k to 600k, a massive data transfer reduction over a mobile network and not bad for just an hours investment in tweaking the LINQ statement.

Working on features

After I had confirmed I was able to successfully download the session data and populate the collections locally, I moved onto thinking about what I would want in a conference companion app. The most important features/scenarios for me were:

I have just walked out of a session, and I need to look up what talks are happening next.

What are all of the MVVM sessions that are happening during the conference.

Speakers will regularly recommend other talks to go to. Being able to look up the session codes quickly is important.

The delegate handout only has a list of session times and titles. The abstracts aren’t listed. Give the delegates a way to look up a session for more information.

Who is the speaker for this session I am in right now.

I want to look up a speaker a like, and see what talks they are doing.

Being able to favourite a session so I can get a quick overview of when sessions I want to attend are on.

Cache the sessions for 2 hours to reduce network usage on data plans.

XamList

Using the NetAdvantage XamList helped me to implement the vast majority of my feature wish list without writing any code. After downloading the session data, I simply used databinding to connect it to the XamList control. The control automatically supports searching through the data in the list, and will look through all the properties that you ask it to (session title, session code, abstract, room location, etc.). That immediately took care of searching for a session based on a number of criteria.

I created another pivot to allow the delegates to see what sessions are on during each time slot. The XamList also supports grouping of data automatically. After defining that the data should be grouped based on session time, I straight away had another requirement completed again without requiring any code.

Implementing the remaining features

With the XamList ticking of the majority of my requirements, it left only 2 major features left that required coding:

Caching

Favourites

Favouriting sessions had already been roughly implemented in the conference starter kit. However it only saved sessions when the app is tombstoned, not when you closed an app or under a few other conditions. I fixed up the favourites code, changed some icons, etc.

To solve the caching feature, I simply stored the collection holding the session data direct in isolated storage and then loaded it back up the next time the app started

Final thoughts

If I had enough time, then I would have re-written this from scratch, rather than used the template. I ripped out a lot of the custom code in the template and replaced it with the features built into the XamList. It wasn’t until the 4th day, after replacing all the features that I realised “Oh, I didn’t actually need anything in this template, except for the favourites code (which I modified anyway). But as there was only 2 days until the deadline it was not worth it just for the sake of “application purity”.

Next time I’ll definitely be asking for a bit longer lead time / access to the OData feed. It was a mad rush to try and get it all completed in time, and resulted in lots of shortcuts to get things done in time which I still feel dirty about (e.g. messy code).

Abstract: David Burela takes anyone new to Desktop development through the basics of developing for Windows 8. XAML, Databinding, DataTemplates and ViewModels will all be introduced. Discover how to separate your UI from your business logic, how to create List Views that display your data richly, how portable libraries can help your business logic be used cross platform, plus much more. The techniques will be focused on Windows 8, but can be applied to any XAML based application: WinRT, Windows Phone, WPF, Silverlight 5.