Android: Initial Thoughts and Traffic App
I have been meaning to get into the Andoid SDK for a while but I was having some time off from doing any development at home so I left it alone for a while. Well now I am back and I have been having a play around with the SDK and the emulator. This is a screenshot of an application I put together which uses the current GPS location to look for local traffic situations using the Yahoo traffic API.

I won’t lie and say I knocked this together really quickly because I didn’t, it was a bit of a hard slog and it still doesn’t display any icons to indicate the situation type like I had planned. I put this up just to show what I have been working on. I have to say as someone who likes to play about with frameworks that I found this pretty difficult, maybe because I wanted to do it properly and not cut corners. Highlights are:
- Uses AlarmManager like the AlarmService example in the API examples to trigger a background service which launches a thread to download Yahoo traffic reports based on the current GPS position (and a fixed radius – I haven’t got around to making any other views yet).
- Uses SAX parser handler to extract the XML values and builds a temporary list of traffic objects.
- The traffic service writes the traffic data to a custom ContentProvider. Data is stored in rows in a database.
- The view list activity listens for notifications from the ContentProvider for updates to the data and redraws the master list accordingly.
First impressions? I had no idea it would be quite as difficult to use the framework. It was simple downloading the SDK and getting the sample applications up and running (not my experience with J2ME but that was a while ago). But, actually creating something was a bit of a culture shock even for a hardened framework explorer like me. There is lots of terminology and concepts to get your head around.
My initial impetus for the application was from a different direction to just getting traffic reports. I first started by thinking about what sort of things you could do with a wireless device with a built in GPS that could be applied to traffic information. What popped into my head was a system like this. The GPS in the phone could be used to calculate a travelling speed and this along with current position could be sent to a central server which would aggregate this information for your area. Based on reports from other users a picture of real surrounding road conditions could be built up.
A quick check on the net revealed that there is already another project along these lines here Jamdroid.
Also, I reckon this does something similar was well in terms of pinning the location to a road or route.
Google are also into this stuff with their acquisition of a company called ZipDash. There is a description of the companies patent application here.
An existing hand held device here.
I will probably keep plugging away at this anyway and will keep you posted. Nothing until next week as I have a busy weekend.
Comments
Leave a Reply