There has been a lot of discussion recently about the advantages and disadvantages of both native mobile applications — colloquially referred to as just “apps” — and Progressive Web Apps, which allow people to use website functionality whilst offline.
One of the big advantages of PWAs is that you don’t have to install them; they reside in your browsers cache, no user interaction required. However, I think a bigger advantage in that area is that you don’t have to update them, just refresh the page!
Updating apps is a chore — yes, it’s better than the experience on a desktop machine where every application has its own update daemon or requires complete re-installation — but it’s still not something that as a user I particularly look forward to doing.
It’s made all the worse when something like the below screenshot is what awaits me behind the App Store update badge.
You wouldn’t let someone borrow your phone without them telling you why they want access to it (ringing international numbers or randomly deleting my contacts is a big no-no) so I don’t see why we should allow developers who won’t even tell us their intentions install things to our devices.
Yes, you’ll never truely know whats going on unless you have a copy of their source repository and a corresponding hash to test the binary you’re going to install against (and even then, what if someone hacked their compiler… etc.) but it would at least be nice to know what, in their own words, they’re intending to get your device to do. Especially seen as data caps and storage limitations are still a big deal on mobile.
Normally applications say something along the lines of “We update every week, make sure to keep updating us”, but I felt that Twitter really won the battle for most absurd update description this week:
Not too much has changed. But enough to warrent an update. Happy Tweeting!
Even if we ignore that fact that the first full-stop in that paragraph should be a comma, it still doesn’t make much sense. What size does a change have to be in order to warrent sending a 78.4MB package to millions of users? How do they quantify not much? What are you doing to my phone?
Now, I’m not for a moment suggesting we get a list of git commits which have entered an apps master branch and display those to the user — the average user is certainly not technical enough to appreciate that, however, it would be nice to at least list features or things that have been fixed.
Credit where credit is due, Spotify release fantastic update descriptions for their applications, where they use this exact approach. New features are highlighted, followed by bugs which have been resolved and finally, to make it a little bit fun, they add a description of a “Fictitious” improvement such as “This app is now available in three new fruit flavours. (Berry Surprise is still quite buggy.)”. That bit of humour makes people more likely to check out app updates and question what is being ran on their device — which I think is no bad thing.
So developers, please write better update descriptions. It’s exciting to release new features or fix a bug that has been haunting someone for a week — let the people know you’ve done just that!
Trains are, in many respects, wonderful machines. They’re simultaneously both the most romantic form of travel and the most grueling way to get to work every morning. One thing trains are not however, is up-to-date with modern technology.
Whilst you can follow the course, in real time, of a plane soaring at 36,000 feet above the ground all the way from San Francisco to London you may be surprised that Train Operating Companies (TOCs) lack the ability to pinpoint the locations of their trains between stations. In other words, they may know that your train is between Cambridge and Foxton but they wont know exactly where.
Not knowing exactly where Trains are doesn’t cause any satefy issues — Block Signalling has been used to safely manage the passage of trains by identifying which “block” of track they were in, without an exact location, since the 1850s — however, it does mean that the decisions that control rooms make are being made on educated guesses of a trains exact position at any given time.
Control rooms are the brain room of the modern railway and make decisions when things go wrong. If you’ve ever been told a train cannot run due to a “lack of train crew” its unlikely the driver was off sick and instead much more likely that a delay on a train they were driving earlier has cascaded down to your service and they simply never arrived at your station to drive the train. Control rooms try to avoid this — and many other issues.
Our earlier examples of Cambridge and Foxton aren’t exactly a million miles apart, and on a normal service you would expect a train to travel between them in around 5 minutes — but as the railway gets more and more congested making real-time decisions based on a time resolution of minutes will result in more and more decisions resulting in delays and cancelations.
After having learnt about this situation, whilst onboard HackTrain 2.0, I decided to have a go at resolving it in my own time.
One constraint of working with technology for use on trains is that, for all intents and purposes, you cannot add hardware to trains. The Rail Industry in the UK is, thankfully, obsessed with safety and that means that anything added to a train has to go through rigorous Health & Safety checks. This means it can take months, or years, for anything to be installed trackside or in a vehicle.
Whilst staff who work for South West Trains (who explained the situation to HackTrain competitors) are all issued with BlackBerry devices, some companies have started issueing their Guards and Conductors with relatively modern Android devices, some of which even act as ticket printing machine for on-the-train ticket purchases.
Armed with this knowledge I decided to try and validate my idea that a train could be tracked using just the smartphone device a member of train crew is already carrying. As I didn’t know if the idea would work in reality I set about making a working prototype with the minimum possible effort.
My acceptance criteria was pretty simple: Be able to view in real time the position of a train from Cambridge to Kings Cross. This wasn’t exactly the most measurable criteria (what does “real time” mean, for example?) but it gave me something to work towards.
I walked down a few streets with my prototype client open in the Safari Browser on my iPhone and it appeared to report its location to the server as intended. So, on one of my final commutes into work before the holiday season I tested the system on a moving train on a route that includes tunnels, large areas of poor phone signal and central London; and all the different challenges these environments bring.
I was pleasently suprised with the results, shown above , despite a few anomalies.
Due to the fact I was using the `watchLocation()` function the train didn’t report its location in even time periods, as it would if you were polling the location, but rather only when the trains position changed significantly. Despite this fact, the period between the train attemting to send its location whilst on the move was never more than around 10 seconds.
I say attempted because, as expected, there were some issues with mobile coverage. I had expected to have issues in tunnels, but actually only the final tunnel before Kings Cross (which goes under the Grand Union Canal) caused issues. Lack of signal otherwised occured in a few blackspots in rural Cambridgeshire. This issue could be mitigated by employing a system such as that provided by Nomad Digital which provides an internet connection to a train using multiple sim cards connected to multiple network providers.
Another issue you can see in the above screenshot is that my train appears to have left the tracks a few times. I can assure you that this didn’t actually happen, but appears to have done so due to a combination of some inaccurate GPS readings and some failed data transfer caused by the aforementioned network connectivity problems. These errors could be mitigated using a host of techniques: comparing GPS position to known track locations, buffering changes in location that seem too great and only accepting them as true if subsequent location changes appear to be in the same area.
This was a pretty interesting project to work on. It gave me an oppertunity to develop a simple solution to a real life problem in a short period of time and learn about the awesome Socket.io library. I was happy to see it work so well, and to be wrong about tunnels. I look forward to making some of the improvements I’ve mentioned in this post and making the UI prettier and data storage a little bit more resilient.
Microsoft is really heating up its drive to get more applications in the Windows Store, as part of this push they have a few competitions on — which, if you’re a developer you should definitely check out!
One of these is the Creative Bloq App Generator competition, which is described below:
Whether you’re an experienced Windows developer or a newcomer to the platform, there’s an incredible range of prizes to be won – and EVERYONE who enters has a chance to win. As well as prizes for the Ten Best Apps and the overall Grand Prize winner, there are also 28 daily draws, where winners will be randomly chosen to receive some fantastic prizes. All you need to do is register here, either with a live app in the Windows Store or with an app you are building – or even just thinking about building. And as soon as your app is available for download in the Windows Store, you’ll be entered into the draws and competition.
A lovely blurry photo of Rob Miles Auctioning off words for TTG October 2012
Today was the word auction for Three Thing Game October 2012. 🙂 My Team, Did You Mean “Uncle Mike’s Recursive Prolog Party?”, bid for the word fighting and, because nobody else wanted it enough to bid for it, were assigned the word toast.
At this point we were understandably wondering what in the world could link these two words in a way that wasn’t totally weird, we decided to hold off on making any rash weird game play ideas before getting our third and final word. Unfortunately we ran out of time and so Rob put off auctioning out the final words until Wednesday lunch time. Because some teams — including ourselves — were eager to get started Rob said that if we didn’t want to wait to bit on items on Wednesday we could he said we could be assigned a random word by email if we would prefer.
We did and got ourselves Party, which ties in surprisingly well with our idea. Which of course I wont be telling you anything about until Saturday at the earliest. Remember to check back for a livesteam/liveblog of the final 24 hour sprint to the Three Thing Game finish 🙂
In a continuation of the Hull CS Blogs teams quest for world domination Alex Pringle has designed, developed and published an Android Version of my Hull CS Blogs app. The application uses the same data sources as my application and is very similar to use, its also based off of the same code.
Today I recieved an Email from Phil Cross congratulating me on being “selected as a Top Apps winner” in the Microsoft UK Students Student Incentive Program.
Here is an overview of what the incentive scheme consisted of:
We know you love the way Windows Phone puts People First. Do you want to win one? Course you do!
We have put together a competition for those people who like writing apps for mobile devices. With our latest programme, only available to students aged 16 or over in the UK, we want to encourage you to write an app and submit it into the Marketplace.
For EVERY app you write, during the periods of the competition, (see the detailed terms and conditions here) you’ll have a chance to win one of 100 Nokia Lumia Windows Phones. We also want to reward those who write top quality apps so we are complimenting the random prize draw with a judged competition, the top prize being a trip to our offices to spend a day honing your skills and your apps with our deep technical experts.
I didn’t win the in random monthly draw, but I did win for writing a “top quality app” — this means I get to go to the Microsoft Technology Centre in Reading for a day to spend time with the experts improving my applications in the store! Definitely something for the CV and a chance to improve my products and brand image! Microsoft are even paying my travel expenses!
I’d like to thank Phil Cross and everyone at Microsoft for giving me another great oppertunity, especially so soon after the last one.
A few weeks ago a link was posted on the Microsoft UK Student Developer Group detailing a Windows Phone 7 – Windows 8 weekend in London. Originally the location wasn’t released, presumably whilst Microsoft worked out how many people would come and how much room they needed, but eventually we were told it would be at the Commonwealth Club at Embankment in London. This is the nice building you can see in the above photo! The event itself was this weekend just passed, I couldn’t make the Sunday but thoroughly enjoyed Saturdays festivities.
It was a snazzy place, and a great place to stay for the day, but I’ll talk more about that later. The idea of the weekend was to show people how to port their application from Windows Phone 7 to Windows 8. It also showed off some of the new API’s, Runtimes and paradigms that make Windows 8 apps an improvement over those of the phone — though I’m sure there will be API and feature parity in Windows Phone 8.
When I got to the commonwealth club I was shown to the basement floor which had been taken over by Microsoft (the only company who would schedule a Phone related event in a basement with no phone signal ;))
One room was the “Work Zone” where developers could actively work on porting their applications from Windows Phone 7 – Windows 8 with the help of the Microsoft Evangelists.
Another was the “Game Zone” where people could play Star Wars Kinect competitions to win prizes such as DAB radios. The final area was the “Talk Zone”, in which mini lectures were held with topics that had been voted in by the people at the event.
The C# 5 / .NET 4.5 / WinRT Asynchronous Framework
The most popularly requested talk, and therefore the one we got to see first was a talk on C#, .NET 4.5 and WinRT’s new asynchronous framework. Whereas at the moment to send a WebClient to fetch some data and then display it you’d have to do some code like the following:
//Actual simplified (i.e. no error reporting etc) code from the Hull CS Blogs app for Windows Phone 7
//Set up downloader somewhere
WebClient contributorsXMLDownloader = new WebClient();
contributorsXMLDownloader.UseDefaultCredentials = true;
contributorsXMLDownloader.DownloadStringAsync(new Uri("http://www.dantonybrown.com/hullcompsciblogs/contributors.xml", UriKind.Absolute));
contributorsXMLDownloader.DownloadStringCompleted += contributorsXMLDownloadComplete;
//In another totally seperate place
public void contributorsXMLDownloadComplete(object sender, DownloadStringCompletedEventArgs e)
if (e.Error == null)
XDocument xdoc = new XDocument();
xdoc = XDocument.Parse(e.Result, LoadOptions.None);
contributorsListBox.ItemsSource = contributorsList;
As you can see, we set it up and then at a later time the method we specified in the event handler earlier is called once the download is complete. If you have loads of these async calls, or worst yet async calls within async calls it all gets very confusing, very very quickly.
In C# 5 two new keywords have been implemented to ease this situation. Async, which as you can guess marks a method call as being one that is executed asynchronously and await which says “don’t execute code under me until this async method is complete”.
For example we can convert our above code to a HTTPWebRequest using the new keywords. Look how simple it is!
public async void DownloadContributors()
HttpClient http = new System.Net.Http.HttpClient();
//Notice how we're awaiting this response right here rather than going to an event handler
HttpResponseMessage response = await http.GetAsync("http://www.dantonybrown.com/hullcompsciblogs/contributors.xml");
//We'll only get here once the response has completed!
string result = await response.Content.ReadAsStringAsync();
//Business Logic that would normally be in the event handler
XDocument xdoc = new XDocument();
xdoc = XDocument.Parse(result, LoadOptions.None);
contributorsListBox.ItemsSource = contributorsList;
It’s nice because everything is where it should logically be. Together. Anyway, theres a hell of a lot more to talk about that I can fit in this already packed blopost, for example any method which calls another method which is marked as async has to be async itself, but you can find out all this at Channel 9.
The Windows 8 User Experience (UX)
Metro is all about making an experience for the user, from Live Tiles which mean you don’t have to even enter an application to get its content to the exact alignment and size of text of titles, sub-titles and paragraphs in apps. Andrew Spooner delivered a great talk on how to achieve the best user experience for users when porting your application from Windows Phone to Windows 8.
Although a lot of things can be directly ported in some ways — a panorama application on Windows Phone can be a panorama application on Windows 8 — some things can’t. Windows 8 has no concept of a Pivot page for example.
Because pivot screens are often used to filter content, in my example the blog pivot shows only blog posts whilst the twitter pivot shows only tweets, there are a few ways to get round the limitation. You could use an application bar, a context menu or change the overall layout of the page.
Andrew also explained about the different modes a page can be in. Landscape, Portrait or pinned to the side, and how to deal with each. You can find out more about redesigning your Windows Phone 7 application to Windows 8 or designing a new application from scratch here.
The idea behind a contract is that it is a way for an app to communicate with other applications in a standard way, even ones it doesn’t know about. For example a share contract says “I have these images that can be shared”. Any application that can accept images then says “I can accept these images and do something with them”. Notice how the sharing application doesn’t say what it wants done with the images and the receiving application doesn’t tell what it can do — this is on purpose to allow more interesting experiences.
If the user selects that your application it receives the images and can do anything with them, for example allow the user the edit them or share them straight to a social network. 🙂 Its all really cool stuff and allows experiences that no one would previous think of, the example given was a cooking application that shares pictures of food. An application that accepts pictures could then make it into an interactive Jigsaw. Why anyone would want to do this is unknown… by everyone. But you can see it allows us to do things we wouldn’t previously have thought of. I mean who, when writing a cooking application writes in a MakeJigsaw() method? No one 😛 But Windows 8 will allow this important functionality! 😉
Search isn’t the only type of contract. Previously to this event I hadn’t seen the Settings Contract but it looks quite cool. It allows your app to store its settings in a uniform way within the right hand pane which comes up when the settings charm is pressed. Some of this might not make sense now, but it will when you use Windows 8. Its nice because it allows applications to have application specific settings in the same place as universal ones such as “Allow this app access to location data” 🙂
Background Tasks on Windows 8
Background tasks on Windows 8 are very similar to background tasks on Windows Phone 7… apparently. I’ve never used them, but it’ll be a nice easy port for those people who have. There are all the sort of optimized background tasks you expect:
Media player (Audio AND Video, whereas on Windows Phone 7 it can only do audio)
Update Tile and Notification
There’s also a generic background task which is unoptimized but allows you to do whatever you want. We were advised that this was a last resort and if we could use one of the more optimized background tasks to do whatever we wanted to achieve we should. Background tasks can be activated in several ways:
By a timer
When a certain condition is met (e.g. WiFi connection state changed)
By custom rules (e.g. Connection State changed && connection state is online)
In a background task you can write any code you want and are totally unlimited. The only thing to be aware of is that normal applications only get 1 second of background task CPU time ever 2 hours in order to retain battery life.
New in Windows 8 are notifications on the lock screen. 1 application, chosen by the user, can display its notifcations on the lock screen. Much like the calendar application does on Windows Phone 7. This chosen application is special because it gets 2 seconds of CPU time every 15 minutes.
One of the interesting but non-CS parts of the day was the dinner. It was kind of weird, but cute. Lots of small versions of popular dishes such as burgers, there are some pictures below.
Getting on the Windows 8 Marketplace for Day One of General Availability
One of the opportunities of the event was to discuss getting a “store token” which allows your application to be on the store the day Microsoft releases Windows 8, days — possibly weeks before your competitors. I spoke to Paul Lo about this and should find out if I’ve successfully received a token soon!
Getting help with Hull CS Blogs for Windows 8
The best and most helpful part of the day for me was having a 40 odd minute chat with Andrew Spooner about porting my applications design to Windows 8. We used a programming statement and some use cases to think about the experiance — this was a methodology I haven’t used before and I found it incredibly useful, I shall be using it from now on!
A programming statement is a paragraph or two explaining what your application or program is all about, for example my one was
The Hull CS Blogs application aims to deliver the content of all the bloggers at the University of Hull Computer Science department to users in an attractive way whilst allowing people to discover more about each contributor, via the use of twitter streams and a list of applications they have worked on. The application will also deliver a regularly updated list of featured applications developed by people within the universities computer science department.
Having this statement allows you to have something to refer back to when you’re thinking about features, for example. “I’m writing an application which allows people to discover about the contributors through the use of twitter, do I need to have a reteweet feature?” Well, the use of twitter in the application is to discover things, not necessarily interact with content, so this should be left out til a later release where there aren’t other more important features to be developed. (By the way, this idea was actually one discussed about the Hull CS Blogs application)
A set of use cases are the “stories” of how you envisage people using your application. For example one of mine was
Russell has missed a guest lecture at university, he wants to read up about it and knows that his fellow computer scientists will most likely have blogged and tweeted about it. He opens the Hull CS blogs app and views the latest blogs and reads a couple. He then looks at the latest tweets for more minute by minute information, and then drills down into James’ contributor page because he cares about james’ opinion and wants to see more about what he has to say about the event both via twitter and his latest blog posts.
Reading this makes you realise what features are crucial to your app. So in this situation you would need.
Latest blog list
Feed of all tweets by all users
A page for each user
Without this user case I wouldn’t have thought about implementing an overall twitter feed in the main panorama rather than just a per user feed in each contributors page.
Anyway in the end we went from these initial designs, which are essentially a direct port of the Windows Phone app:
To this overall view of the application in a hierarchical order:
I will be using this design for the actual version of the Hull CS Blogs app for Windows 8, so check back here to hear more about that.
I apologise for the length of this post but it really was such a packed day! I hope this blog has made you look forward to developing for Windows 8 and porting your existing WP7 applications, because I certainly am! I’d like to thank Microsoft for treating me so well as they always do, with lots of support, free drinks and some amazing free food. Truely an experience worth remembering!
Friday night the Hull Computer Science app for Windows Phone 7 finally got certified and accepted onto the marketplace. I say finally but it has to be said that this is the quickest an app of mine has passed through the process — taking just 3 days as opposed to the normal 5.
It’s also the first time I have passed certification first time, which can’t be a bad time. It’s safe to say that the beta I mentioned in my previous blog post definitely helped, as well as me being more stringent about having built in error checking around methods that could fail (for example a network request or file I/O operation).
If you want to download the application you can do so by clicking here.
Again a special thanks to the following people:
John Van Rij for his help with the back end of Hull Comp Sci Blogs.com
Rob Crocombe for general support throughout the process and the icon design
Rob Miles for the photography used in the application
In other exciting news fellow blogger and Hull Computer Scientist, Cameron Wilby, is porting my application to iOS, the operating system which runs both iPhones and iPads. You can see some very early builds of this in the images below:
As you can see its a direct port, with all the same features as the Windows Phone 7 application. I’ll start work on the Android version soon, and then we’ll have total Smartphone coverage across the 3 main platforms! Good stuff!