beatonma.org

Commons

A political encyclopedia, intended to make UK politics more engaging

Commons started as an Android app, originally released in 2015. While it got good reviews for its initial release, particularly from school students, it had a rudimentary back-end which made data updates difficult (initially using an on-device database updated via app updates, and later updated by replacing it with an entirely new database file hosted on my Google Drive[!]). It also lacked ‘stickiness’ - it provided lots of information with a nice UI, but no real reason to keep using it.

A lot has changed since then, both in terms of the technology used, and the national and international political landscape.

As a result, it has been something of an albatross for me - something that I keep coming back to, implementing features and pouring many hours and days and weeks of work into, without ever having an entirely clear vision of what it’s actually supposed to be when it’s ‘done’.

I eventually dropped the idea of actually releasing it and instead continue to work on it only as a personal learning playground and portfolio piece.

It now has a Django back-end with an API and fully automated updates from primary-source Parliamentary APIs. It has career and voting histories for every MP and Lord and makes their registered financial interests readable and searchable. It has constituency maps and location features. It has user accounts and social features (although I fear the chronic migraine that would inevitably result from ever enabling them)…

It now runs as a portable Docker Compose project, instead of the fragile Pandora’s Box of a Raspberry Pi which used to sit on my desk.

Its Android client has gone through several iterations as well, originally written in Java with XML views, later experimenting with MotionLayout and finally migrating fully to Kotlin and Jetpack Compose. More recently, I have started making a web client for it using NextJS - partly because I wanted to learn NextJS, and partly because it’s much easier to share a demo of a webapp than an Android app.

Ultimately, Commons is a failed product. But for the many challenges it has thrown at me and the necessary learning of new technologies that followed, I still can’t help but love it.

Changelog

changelog

This is mostly a behind-the-scenes update to make the app easier to maintain. (There are some user-facing changes too - see the 2nd half of this post for details)

Most of the data shown in Commons is pulled from the web at runtime, but some is cached to make the experience smoother. The cache was originally constructed in a relatively hands-on, piecemeal way because I didn’t expect it would be worth the development time to automate. I thought the data was relatively static, maybe needing updated once a year or so, but the last couple of months in UK politics has proven that assumption very wrong!

So I have now built a proper back-end to handle cache updates automatically. My server periodically rebuilds the database to check for changes and notifies me when an update is available.

I’ve made a simple little management app for myself to make this ‘quality control’ step as simple as possible. This lets me install the update for myself so that I can confirm that nothing is broken before pushing it out to other users.

It also lets me manage featured people and groups that will be shown on the main app’s front page. For example, I’m currently using this to highlight the newly appointed ministers in the Cabinet, as well as the candidates in the Labour leadership contest. Going forward, I can use it to feature any other groups of particular contemporary interest to ensure the MPs who people are looking for the most are the easiest to find quickly.

So in summary, the app content is now super easy to keep up-to-date and should never fall behind again!

App updates:

  • Automatic night mode.
  • As mentioned above, the front page now allows featured collections of people so that, for example, party leadership candidates can be displayed together.
  • Constituency maps are now handled in-app (no longer requires Google Earth).
  • Full support for multiwindow in Android Nougat.
  • Enabled pull-to-refresh on the front pages.
  • Improved animations and transitions.
  • Optimisation and generally cleaner code.

Bug fixes:

  • Fixed startup crash on some devices running Android 5.0.
  • Empty sections in the ‘Upcoming’ section are now handled more gracefully.

changelog
  • Rebuilt home activity for a smoother and more organised experience. This will continue to evolve as new features are implemented, but for now it is split into three tabs:

    • ‘People’ tab includes your favourites and featured MPs.
    • ‘Recent’ tab shows a summary of debates from the most recent day available.
    • New ‘Upcoming’ tab shows the schedule for the current (or next available) day. Includes a button to check what is currently being shown on BBC Parliament and a link to watch it on iPlayer.
  • Added constituency phone numbers (where available) to contact card.

  • Most data items can now be long-pressed to copy their text to your clipboard.
  • Tapping on the constituency now provides a link to view its page on Wikipedia.
  • Fixed inconsistencies that could occur with the accent colour in MP profiles.
  • Minor stability fixes.

  • New permission: Vibration, used for feedback when you long-press on text to copy it to your clipboard.

changelog

Commons is a tool to make it easier to follow and get involved in UK politics.

Every active MP has a profile full of useful information including:

  • Full political career history
  • An overview of their voting tendencies
  • Their recent debate activity
  • Contact details, social media and other relevant web links

You can search for MPs by their name or constituency, or use location services to easily find your local representative. You can add people you are interested in to your favourites for quicker access from the app homepage or even add a widget to your home screen to easily track their parliamentary debating activity.

Data in the app is collated from parliament.uk, TheyWorkForYou and Wikipedia.