redbus mostly complete

Well, I’ve just been putting the finishing touches on redbus’ last major feature: bus stop location data updates.  This isn’t released yet; as its the sort of thing I really don’t want to go wrong on other people’s phones, I’m testing it on mine for a few days first.

I’m quite pleased with the "highly scalable redundant back-end data processing and distribution architecture" I’ve ended up with. Otherwise known as a cron job running on my server at midnight that:

  1. Downloads all the stop location data from lothian’s website.
  2. Munges it.
  3. Checks if anything has changed.
  4. if it has, it uploads a new stop database to here.

The Android clients now simply download the HTML of the project downloads page every day or so and run a regexp over it. If a newer file is present, it checks with the user, downloads it and installs it. Originally I was just going to check the file into SVN, but since we have over 1000 active users now, I felt that using Google’s project file download system was probably more scalable.

I’ve also completely redesigned the file format to be more compact, switched to using fixed point integers for lat/lon instead of floating point doubles, and it can now cope with up to 128 bus services. At the same time I’ve rewritten the map overlay draw routine to use an efficient double buffering system I dreamed up on the bus one afternoon.

The end result of all this is that the app can now display pretty much all  the stops in Edinburgh at once without any tricks. If, say, there were to be a sudden increase in the number of stops, we should be in a really good position to support it. 🙂

This also means I should be free soon to devote time to my other projects, such as USB support and the AOSP build I’m working on.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

%d bloggers like this: