Police.uk Update and Droidcon 2011


I’m making some good progress on the Police.uk app. I know it’s been a long time since I’ve talked about it, but I’ve been busy writing apps for other people.

I’ve got search working. It works really well with anything like postcodes or place names. There are still a few problems with it showing results from outside the UK though. I need to look into that a bit more.

I’m also changing how the force and neighbourhood information pages work. I’m making use of viewflow by Patrik Åkerfeldt to show more information on the pages. I’ll post some screenshots on twitter when I have it looking nice. I’m also adding some new bits of data like local events, social network links for forces and the local team of officers. If anyone happens to know of an open database of police photos, get in touch. I know that some forces have them because the Police.uk displays photographs for some of the neighbourhood policing team. Would be nice to have some photos in the app.

I’ve also started collecting the crime data so I can implement some historical data. This isn’t provided by the API so I’m collecting the data manually at the minute.

I’ll be sending out a new beta version to anyone signed up soon. If you want to help out sign up here (there might be goodies in it eventually).

Droidcon 2011

If you’re into Android at all in can get to London on the 6th and 7th of October 2011 then you should defiantly think about attending Droidcon. I attended last year and had a great time. A lovely group of people, lots of interesting talks and very inspiring. The speaker list is looks just as good, if not better than last year.

I’m told there’s still a few (be quick!) early bird tickets available, which you can get from their website.

If you are going, give me a shout on Twitter or in the comments. Always nice to meet people!

Posted in Android, The Weekend Project | 2 Comments

And we’re back…. for now

I’m having a few problems with my VPS at the minute. I’ve been attempting to fix it this afternoon and thing I’ve got it to a stable state now. Hopefully it will stay up for a bit.

The problem seems to be that when I get a few visitors at once the VPS runs out of memory and falls over. I’m thinking of moving the blog over to another system so I can deal with traffic, however I’m still looking into it at the minute. I may end up just increasing the amount of memory I have on the server.

Ah well, back for now at least :-)

P.S. I’ve not been working on the Police.uk project for the past few weeks due to end of year exams at university. I finish next Tuesday so I’ll be starting back on it then hopefully

Posted in Blogging | 3 Comments

Using Eclipse under Ubuntu 11.04 (Natty)

Just a quick tip you you try and use Eclipse under Ubuntu 11.04.

Because of the new global menubar thing (which I do quite like) and a bug with Java applications you cant get to any menu items in Eclipse.

To get round this you just need to run a command before you launch Eclipse. To assist with this I picked up a little script. Simple put this in a file, make it executable and run it:


Simple enough but tripped me up for a while.


Posted in Coding | 13 Comments

Ubuntu 11.04 First Impressions

Yesterday I took the long overdue step of wiping my laptop completely and reinstalling everything from scratch.

First Stop: Windows 7

This time as well as reinstalling Ubuntu I thought I would redo Windows as well. I only duel boot Windows for games really. For some reason I’d be having major problems with the stability of Steam. Just to launch Left 4 Dead 2 caused a few crashes.

Thankfully Installing Windows 7 only takes about an hour. Install the operating system, install Chrome and Steam then just copy my game backups back from my external hard drive. Job done.

Natty: Installation

One tip if you’re going to install Natty. Don’t bother pressing the download updates in the background button. When it finished installing all the rest of the operating system it still had over half and hour left on those downloads. Thankfully there was a skip button. It’s worth just waiting until you’ve set everything up.

Apart from that the installation was smooth. I messed around with the partitions to get them exactly the size I wanted. Even that fairly advanced action was fairly simple. If you didn’t do that it would be easy enough for anyone to do it.

First Impressions

Upon first boot I was impressed by the new layout of things.

I was a bit fan of the appindicator icons in the top panel in 10.10 and I’m glad to see that they are the only thing that’s allowed now. It ends up with a much cleaner look and what happens when you click on them is much more consistent than the normal notification area.

The launcher is something that I haven’t had time to get used to. At the minute I could take it or leave it, but we’ll see what happens when I start doing actual work with it.

The dash is something I’ve found useful so far. Just pressing the super key and typing what you want to open is very useful.

One massive annoyance

The software centre.

The first thing I did on Ubuntu was to try and install Chrome. As soon as I tried to open the .deb file it opened in the software centre. When I pressed install it locked up and had to be force closed.

Honestly, the software centre is a great idea, however it needs a lot of work. When when it doesn’t crash it’s slow and buggy.


Overall I’m fairly impressed with Natty so far. I think it’s a massive change in user interface and will take some getting used to, but my impressions are fairly good so far.

Posted in Uncategorized | 1 Comment

Android Manchester Talk – Intents: The Glue That Binds

I’ve had a few requests to post the slides and demos from my talk last night at Android Manchester.

For those who didn’t go the talk is about Intents, and the more advanced ways they can be used. The slides are fairly basic, and a lot of the information was things that I said in addition to what was on the screen. There is a video of the event, however it wasn’t recorded by me. Assuming the quality is good (it was a trial run of videoing the talks) I’m sure it will be posted onto YouTube. I’ll post on here if it does become available as that will have a lot more information in it.

Here are the slides I used on the night:

As well as this you can get the source code for the demo Twitter applications on GitHub.

If you don’t want to view the source you can always just install the applications directly onto an Android phone or an emulator:

If you have any questions about the talk or demos leave a comment. I’m tempted to write up a full blog post about this topic as the slides don’t really have all the information that’s required. That all depends on how much time I have though.

Posted in Android | 2 Comments

No it’s not dead…

Contrary to the lack of blog posts the weekend project is not dead. I’ve been quite busy in the week with university work, among other things so I’ve just not had time to write up what I’ve been doing.

I still don’t have a lot of free time so this write up will be fairly brief. Hopefully the pictures and screenshots will keep you amused!

What I’ve done

I’ve done a fair bit of sketching of interface ideas. It’s mainly revolved around the neighbourhood information activity, as this is where the meat of the information in the API lives. I’ve also given some though as to how to get users to this activity as quickly as possible. Search will play a big part of this and it’s something that I no longer think I can afford to leave out of the first version of the application.

I’ve also started implementing some of these sketches. These are very rough so far (as you can see from the titlebar being completely unfinished) but only took a couple of hours work to get them implemented. You can also clearly see which activity has had the most effort put into it.

The coming weeks

My plan is to keep on working on this as much a I can. I’m resisting the temptation to do university work at weekends but as deadlines get tighter this is going to get harder and harder. I plan on implementing search as soon as I can and then finish off the UI work. After that it will just be tidying up and testing.

Posted in The Weekend Project | 1 Comment

The Weekend Project – Progress So Far

If you’re not sure what the weekend project is: take a look at my previous post

What the plan was

As I mentioned in the introduction to this project, I spent the first weekend working on getting the data into the application. At that point the data was unceremoniously dumped onto the screen. That meant that last weekend it was all about the user interface!

Wireframing Ideas

Before the weekend I’d been sketching out some ideas for the UI. I always work using pen and paper when wireframing. I like that it only takes a minute to sketch a whole screen, so if it’s no good you’ve not wasted any time. It allows you to iterate your ideas quickly and see what does and doesn’t look right.

I used to use a Sharpie when wireframing websites; however when doing mobile stuff I tend to draw a lot smaller, normally so I can fit 6 ideas on a page in my sketchbook. The Sharpie tends to be too thick for this, so I’ve now got a set of Staedler Triplus Fineliners. They’re lovely pens and it’s nice to have the colours sometimes, even though I always wireframe just in the black pen.

The sketchbook I’m using is one that was given out at a Carsonified event a few years back. It’s a lovely book and always either sits by me on my deck or gets taken with me to university, incase I need to sketch an idea down while I’m there.

I’m tempted to write a blog post about this topic at some point. It’s something that I think is important to do as it forces you to think about how the user will flow through the application.

Coding it up

At first I made very slow progress.

I started getting bogged down in making the code perfect well before I had anything remotely working. This lead to problems when things didn’t work out (as they often don’t), and I had to basically throw away the code I’d spent time optimising. In future I’m going to have to remember not to optimise prematurely – it just leads to slow progress overall.

Take 2…

Once I stopped fussing over the code, the progress I made was much better.

The job for this weekend was to make sure all the elements were in the right place in the application and that moving from one activity to another was intuitive and flowed nicely. This means that what I have at the minute is something that’s mostly unstyled (in the sense that everything is just black and white) but actually quite usable.

The only activity where almost no work at all was done was the home screen. That’s because I’m still not 100 percent sure what’s going to be on it . I keep coming up with ideas but I’m never really happy with them. I’ll have to keep working on that.

Another area which desperately needs work, and is next on my list, is showing the user a progress indicator when data is being loaded. At the minute it just shows nothing until it loads or, even worse, shows my test data before changing it for the actual data when it’s loaded.

Here’s a few shots of what I have so far:

Plan for next weekend

As you can probably guess adding some sort of progress indicator is high on my list of priorities. I’m also not completely happy with pressing a button to get the list of neighbourhoods when looking at a police force. I might play around with different ideas for that. Depending on how much I get done on those tasks I might look into caching and the home screen. I think that might be setting myself a little too much work, but we’ll see how it goes.

If you want to keep up-to-date with it all you can subscribe to this blog and follow me on Twitter.

Posted in The Weekend Project | 5 Comments

The Weekend Project – Police.uk

Weekend Calendar

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

Future updates

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!

Posted in Android, Coding, The Weekend Project | 7 Comments

The Android Army

A new addition to my Dead Zebra android army today. Soon I will take over the world with them!


Posted in Android | Tagged , | 2 Comments

Missing Widgets from the Android SDK

As rich and as lovely as the Android SDK can be, there are still lots of places where it is missing some very useful widgets or views. Some of these are things that should have been in the SDK from the start; others are features that Google makes use of in its own applications but are not part of the SDK.

Thankfully some of these features have been implemented by people already so you can still make use of them in your applications. It would still be nice though if Google added features like this in the SDK.

QR Code


This is view that should have been available in the SDK from the very start. It simply allows you to swipe left and right to get to another view. Scanning the QR code will download an APK demo so you can see exactly what I mean.

The view was written by Jason Fry and the source code for the demo and the JAR containing the view is available on his blog.

Quick Actions

Quick Actions is on of the UI design patterns that Google first introduced in the official Twitter application. It is now also used in the search application when you tap the Google logo in the top left corner. It is not part of the SDK however and it’s up to the user to implement it themselves if they want to use the design pattern that Google are advocating (which to me makes no sense).

Thankfully there have been a few implementations of this by Android developers. The best I’ve found so far is available here and is developed by lorenz. I’ve talked about this in a previous post so I wont add too much more. There are a few new screenshots showing how it is being used in real world application though.

YouTube Style Tabs

I really like the style of the tabs in the newest version of the YouTube application. They are the type which lets you swipe left and right to get to the next tab, as well as drag the tab bar around to see the titles for all of the available tabs. They make much more sense to me than the normal tabs and look a lot cleaner, especially on smaller screens.

Unfortunately this style of tab is not available in the SDK, and I’m yet to find an implementation of this available for use online. If you’re aware of one post a comment and I’ll add it to the post.

Posted in Android | Tagged , , , , | Leave a comment