Thursday, 8 March 2012

Auto-refresh feature explained

Not long after My Bus Edinburgh 2.0 was released, I received an e-mail from a user who was a little uncertain about how the auto-refresh feature was supposed to work. A week or so later I received e-mails from another couple of users essentially asking the same question.

I thought it would be useful for me to share this question and my answer to people. The following is the question asked in the first e-mail. It has been edited slightly for spelling, grammar and clarity;


"I've played about with the application for the last couple of days. I can get auto-refresh to work. However, if I lock my phone, it goes to sleep or if I toggle to another app (leaving My Bus Edinburgh running) the auto-refresh feature seems to automatically switch off. So to keep it working I have to keep it in my hand and keep tapping to keep the screen active, which to me defeats the purpose a bit. If I have to stay in the app and keep tapping at the screen I might as well be tapping the refresh button?"
The user of the application makes a valid point and I was happy to clear things up. Here is my response;

"This is how the auto-refresh functionality is intended to work. Let me explain;

When you navigate away from an application by pressing the home key or switching to another application, the application is put in to a 'paused' state. When you press the back key to get out of the application and you're in the root of the application (for My Bus Edinburgh, the home dashboard), the application is ended. If you switch back to the application, the application is 'resumed'. Unless the developer has put in any special background processing, the application will not do anything in the period of time it is paused.

Logically, you then might ask "so why not put in some background processing?". There are two reasons why this is the case;

1) Battery life. Transferring data through a 3G or Wi-Fi connection is consuming on the battery. A user may turn on the auto-refresh functionality and forget to turn it off again, meaning that the bus times are downloaded and processed every 60 seconds, until the the user turns it off, the app is killed or the device is restarted. This could go on for a long time, quickly draining the battery.

2) Strain on the bus tracker system. The application does not work out the bus times for itself, it downloads the data from the My Bus Tracker service provided by Edinburgh council. You may or may not remember, last winter the bus tracker system struggled to cope with the amount of requests for bus times and this made it to the Evening News. The council added in another server to cope with demand. Using the above scenario, if many people forgot to turn off auto-refresh then this would be a huge strain to the bus tracker system. The system already handles hundreds of thousands of requests per day for bus times.

The auto-refresh functionality is not touted as a major feature of the application. It's simply there as a utility function, to save people of the effort of manually hitting refresh. There's no point in the application downloading the bus times if the user isn't even going to look at them. That's why it only makes sense to do so when the user is actively looking at the bus times. Also, buses only update their position in the system every 30 seconds so constantly refreshing the data is unlikely to have much effect, until the bus publishes a new location in the system. I chose 60 seconds as a good balance between data freshness and not putting much strain on the system.

I hope my explanations above go some way to explaining why the auto-refresh functionality performs in the way it does."
I am happy that I have got this answer out in public so that other people can see why this decision, although not immediately obvious, has been taken.

Tuesday, 6 March 2012

My Bus Edinburgh now has a blog

I have decided to create a blog for the application which will discuss the development of the application and the reasons behind why certain decisions are made when creating the application.

My Bus Edinburgh has been hugely popular since it was released back in May 2010. As of writing this post, 39,439 people have downloaded the application and 24,034 people still have the application installed (figures from the Android Market, it is possible the counts are higher than this). The application has been left 367 reviews, with 263 of those reviews being 5 star reviews.

I am humbled by the success of the application. It initially started out as my university project, but it has now become a project which I enjoy doing and I see a great future ahead for it.

User feedback is important to me and it has influenced how I design the application. The 5 star feedback left in the Android Market and the e-mails of praise make the project worth doing for no financial benefit. My gain is knowing that people find my creation useful.

After the release of My Bus Edinburgh 2.0, I received plenty of e-mails from users. The content of the e-mails ranged from praise to concerns to questions. I endeavour to get back to people as soon as I can but this is not always possible.

This blog will contain development related information, such as details of upcoming changes to the application. It will also explain why things are done the way they are in the application, and user feedback will be responded to here if I feel that the answer will benefit more than just that person.

The blog will change its look while I muck around with the design, so do not be alarmed if you return and it looks totally different.

All feedback is greatly appreciated, so if you have used the application and can spare a minute or two of your time, please leave me some feedback by leaving a review in the Android Market and/or send me an e-mail.

There are many plans for this application in the future, just give it time and the feature requests will slowly appear.