Tube Delay Refund for android releasedby jaymz on 14/07/2010
Update (v1.4.0) National Rail & TFL Travelcard support has been added. (August 2nd)
Update (v1.3.2) Some layout rejigging has been done, defaults added and a few more menu options for resetting/prefilling. The preferences layout has also been tidied. (July 17)
Updated (v1.2.0) I have updated this app to disable submission until all the station/date info is added. I’ve also added some more labels to show what’s been entered so far. You must make sure you’ve filled in all the preferences or else it’ll fail (Click menu>preferences). (July 16)
A few days ago I was in bed trying to sleep and I suddenly thought it would be good if there was an app to submit refunds for the tube as you come out. I had in my head the idea of a timer that would count down from 15 minutes and then alert you that you were in valid refund territory.
After I coded said timer, I pushed it live without refund submissions working. I also did a quick google to see what else there was only to discover that there was a company that released the exact same app on the iPhone about 3 months ago. Let this be a lesson that if you are about to code something as an exercise don’t go googling first or you’ll inevitably be put off because “whats the point”.
Several hours later today and it is now submitting refund applications to TFL and I get an email confirmation with the reference number. I’m very happy if incredibly tired. The app is free for now, all the others that do these on Blackberry/iOS are paid for. There doesn’t seem to be one for android yet, the guys that did the iPhone app said they where working on one way back in March or April, not quite sure what happened to it. They’re about to release the blackberry one so for now this is the only refund submission app on android Took me basically 2 days part time.
From a technical point of view this is making use of the apache http libraries to do a GET request for the TFL refund page. It parses that to grab the ASPX Viewstate variable and session cookies. Then it grabs the data from the main activity and combines that with the data stored in shared preferences for the form variables. The POST request is processed and the response parsed again to find the reference number. That’s then displayed via a Toast call. Fairly simple, having to deal with the viewstate crap was probably the most annoying part, that and debugging the actual POST.email@example.com