The Weekend Project
I’ve decided from now on I’m going to have a weekend project. I’ll only work on this at the weekend, and not touch the code during the week to make sure I actually get some work done. The intention is to set myself a fun project to break up the lab work I have to do for university.
I’m not planning on spending all weekend working on this. Last weekend I spent about 5 or 6 hours working on it. I’m thinking this will be the maximum amount of time I’ll spend working on it each weekend, however we’ll see how that goes.
What’s the first project?
About a week or so ago I came across the Police.uk website. It allows you to search by location and bring up the crime rates in your area. It also has information such as local policing teams, and even street by street crime reports.
I’m a sucker for data API’s and the second I saw a sign up form I filled it in and sent it off. A few days later I received the username and password I needed to access the API.
The API itself couldn’t be simpler. There are a number of methods which provide information about forces, neighbourhoods and crime rates. All the information is
returned in the frankly brilliant JSON format so it’s super simple to make use of the data. Whoever’s choice it was to use JSON over XML deserves a massive pat on the back! The only problem I ran into with it was a place where an JSON object was used where I felt a JSON array would be more suited. It’s not a major problem, but led to a lot of confusion at first. The rest of the API was brilliantly designed.
The App Itself
What I’m aiming to actually build is a native Android application which makes us of this API. There is already a web interface which works quite well; so it needs to provide more than that for it to be a useful project. The features I’m planning on implementing include:
- A nice way to browse the data
- The same sort of search provided on the website
- One touch access to information for the location you’re currently at
- A widget which displays the crime rate in the area you’re currently in
- Other features which come to mind along the way
I’m not promising these will all make it in by the time I release the first version, or even that I will be able to add them at all, however it gives you an idea of the direction I’m going to go with this. For it to make sense as a native application it needs to provide something the mobile website can’t. Hopefully I can add features like that to the application.
Progress so far
As I mentioned before, I started working on this last weekend.
The progress I made in the 5-6 hours was surprisingly good. So far the application is able to browse most of the data from the API, and display it on the screen. As I was mainly working on getting the data part working over the first weekend, the user interface is appalling. It essentially just dumps the results on the screen and has buttons for basic navigation.
Overall I spent about 10 minutes on the user interface part of the application, and the rest simply on getting the data from the server, so I’m not going to bother showing what the application looks like. If you can imagine a black background with lots of small white text all bunched up together, you’ll have a good idea of what I’ve got so far.
I’ve started sketching out some ideas for the UI in my notebook. Once I figure out a way to scan these in and make them legible I’ll start posting them up on the blog. I might end up resorting to taking photos of the pages if I can’t get my Canon scanner to work on Linux.
Plans for this weekend
This weekend the main focus will most likely be on the user interface. I know there is more work to do on the backend data side of things, such as caching and all that jazz, but I’d really like to make sure the flow of the application is right before I start optimising the code too much.This quite from an unknown source should be something I should stick to:
Make it work, then make it elegant, then make it fast
In the future I’m thinking I might post on the blog at the start of each week, summarising what I managed to get done over the weekend. I’m not sure how this will work out when I have things to do at university early in the week, but I’ll give it a go.
At the weekend I’ll likely post little bits about that I’m doing on my Twitter account. Hopefully I’ll manage to get some nice screenshots and stuff in there, but no promises.
Hopefully making the application in this way will make sure there is a bigger chance of progress being made. If you want to keep up-to-date with it all you can subscribe to this blog and follow me on Twitter.
Any comments or questions are greatly appreciated!