Posts Tagged ‘overtheair’

My first experience using BlueVia APIs

Sunday, October 2nd, 2011

I wrote yesterday about a quick hack I did at Over The Air using the BlueVia API. I thought it was worth a quick post to show just how simple it was.

Read yesterday’s post for background to the idea behind the hack, but in essence, what I wanted was:

  • monitor the location of my mobile phone
  • send an SMS to a different mobile number when my phone goes into a predefined known area

BlueVia provides an API that let me doing this using network operator data. In other words, nothing needs to run on my phone itself as location data is obtained from where O2 thinks my phone is.

This means there is no battery-life impact on the phone for this monitoring.

It also means this will work with any phone – from iPhones and Androids to cheap feature phones.

The whole thing took me less than an hour and needed only 90 lines of Python.

This is how I did it.

(more…)

Over The Air 2011

Saturday, October 1st, 2011

I’m back from Over The Air 2011 – a mobile tech conference with an overnight hack-a-thon challenge.

This was the fourth year I’ve been to OTA, and I normally submit some random hack.

In fact, this is the first time I didn’t stay up all night, in a 15-hour non-stop coding splurge writing a massive, over-ambitious beast of a mobile app. I must be getting old… this time I wrote a couple of quick hacks, each of which under a couple of hundred lines long, and had eight hours sleep instead. Much more civilised.

This is what I managed to come up with:

hack 1: a crap husband helper

photo of a hack

Sometimes I stop at the shop on the way home from work because I want something. Invariably, I don’t think to check with Amy if we need anything. I get home with a shopping bag, and get something along the lines of “Why didn’t you tell me you were going to the shops? We need nappies.” At which point, I feel like I should dutifully volunteer to go back out to the shop.

Going to a talk on the BlueVia API gave me an idea.

I wrote a bit of Python to run on my home server, that will keep an eye on where my phone is using the BlueVia Location API.

If I go near the shops, it will send a message to my wife using the BlueVia Send SMS API, to say “I’m near <insert shop name here>, do you need me to get you anything?”.

90 lines of Python is all it takes to make me look like a thoughtful and considerate husband. Huzzah.

(more…)

Making National Traffic Control data more useful

Sunday, September 12th, 2010

or ‘my hack for Over The Air 2010’

National Traffic Control Centre - on AndroidYesterday was Over The Air 2010 – a very cool event for mobile developers, that really warrants a post to itself, but I’m too tired so that will have to wait for another day.

But while I was there, I had a go at the hack challenge. I’m pleased that there was a fair amount of interest in what I did, so in this post, I want to share some of the technical details.

The hack centred around getting access to (pseudo-)realtime data about UK roads. It turns out that there is an effort to make traffic and road monitoring data available in a consistent, interchangeable format: DATEX II.

The DATEX site has a list of documentation for the traffic data made available for England, Scotland, Sweden, Italy, Spain, Portugal, Netherlands, and regions in France and Germany. For a data geek, this was quite a cool find 🙂

I only had 24 hours to play, so started with the data available for England – covering the motorway and trunk roads. The web page includes a 39-page PDF which documents the data that the National Traffic Control Centre publishes for England.

The nice thing about DATEX II being an agreed standard is that although I spent the evening working with the English traffic data, once the code was done, there wouldn’t be anything to stop me using the same code with the Scottish data too.

They publish a lot of data – more than I realised was being collected, let alone made publicly available. This chimed well with the keynote on Saturday morning by the brilliant Tim Berners-Lee, in which he talked about the importance of publicly available data.

The data includes:

  • current and future planned roadworks
  • current and future planned events expected to affect traffic
  • unplanned events affecting traffic
  • the current message being displayed on variable message signs (the electronic traffic signs that can be set to display text messages like “don’t drink and drive”)
  • the current graphic being displayed on matrix signs (those square electronic displays that can display icons like which motorway lanes are closed)
  • information about traffic on monitored stretches of road

This was an impressive list – is it just me, or is the ability to find out what is currently written on the electronic sign hanging over every major road in the country seriously cool? No? Okay… so I’m a geek. 🙂

But beyond the list, what was impressive was the amount of detail.

National Traffic Control Centre - on AndroidFor roadworks, you can find out not only where they are, but what type of roadworks they are – e.g. resurfacing, barrier repairs, bridge repairs, etc., what times of day they will be active, when they are expected to finish, the anticipated level of disruption, number of lanes to be closed, and much more.

For events, you can find out the type of event (e.g. if it’s a sports event what type of sport, if it’s an entertainment event what type of entertainment – e.g. boat show), as well as details about times, expected level of disruption, and so on.

For unplanned events, there are codes for a variety of types of events e.g. Spillages are divided into types like chemical, oil, and – unusually – “shed load”. Accidents are categorised into serious, multi-vehicle, vehicle fire, vehicle recovery, overturned vehicle, and so on. Other event codes include animals on road, people on road, obstructions, severe weather like fog, rain, snow, ice, high winds, etc. And loads more. And again, you get all the detail about times, level of disruption and so on.

For the variable message signs, you get the message text itself, the location of the sign, the source of the message (which authority set it), and so on. For the matrix signs, you get the code for the icon being displayed, the location of the sign, the time the message was set, etc.

National Traffic Control Centre - on AndroidFor the traffic data, you get data divided into monitored stretches of road. In the England data, there were tens of thousands of these road sections. For each stretch of road, you get:

  • current average travel times to traverse the section
  • the typical travel for this stretch of road for this time and day of the week based on historical profiles
  • the theoretical ideal travel time if there was no traffic
  • the current average vehical flow rates (number of vehicles per hour) divided into the length of vehicle – how many vehicles shorter than 5.2m, how many vehicles between 5.2m and 6.6m in length, how many vehicles between 6.6m and 11.6m, and how many vehicles longer than 11.6m (the doc warns that “The accuracy of the loops when classifying vehicle lengths is 1% so measurements around each breakpoint could fall into adjacent categories” – like that’s a problem!)
  • the current average vehicle speeds on the stretch of road
  • the current average occupancy for the road

Not only was it detailed, but it was up-to-date. Data is updated at two-minute intervals if you pay for a premier account, or ten minute interals for the free standard account.

This was awesome. So much information!

(more…)

Mobile Widgets – the new hotness?

Wednesday, October 21st, 2009

Over The Air was a month ago now, so this post has been sat in draft for way too long. But I thought it was still worth quickly sharing something noticeable from the event.

By way of quick background for those who aren’t familiar with it, it is an event for mobile developers – a couple of days filled with talks and presentations on all things mobile.

And this year, the big thing seemed to be widgets. There were a lot of talks on widgets. So many, in fact that you could choose a session in every time slot that was about widgets.

(more…)

Push notifications for mobile apps

Wednesday, September 30th, 2009

Update (1 Feb 2011): I’ve shared some better sample code for Android

Last weekend, I went to Imperial College for Over The Air: a conference for mobile developers.

I gave a talk at the event on how to write a mobile application that uses push notifications. It was pretty well received, so I’d thought I’d share it here, too.

I’ve made some notes below to cover roughly what I said at the event. Any comments or questions (or corrections if you spot any!) are very welcome. 🙂

Update (24/10/2009): I revisited this presentation to address some of the feedback that I got on battery life implications of using MQTT.

(more…)

Improving TwitToday – more Today Screen coding

Wednesday, July 23rd, 2008

Twitter client for Windows MobileApart from adding the ability to initiate an internet connection, my Twitter widget for Windows Mobile Today screens is still virtually the same code as I wrote in a few hours overnight at the Over The Air hackday.

Which isn’t great – as I know there have been a bunch of people waiting for me to make some fixes and add some basic features.

Tonight I had a bit of time to spare, so I finally dug out the code to start making a few improvements:

  • Background worker thread
    Today screen widgets are compiled into DLLs. They aren’t a separate executable, and are run by the Today Screen in the Today screen’s (i.e. explorer.exe’s) flow of execution. When the code tries to post to twitter.com, explorer can’t do anything else until that’s finished.

    That might even be tolerable with most websites, but with twitter – which is known to fall over from time to time! – it means TwitToday could effectively hang your phone for ages until the HTTP post timed-out.

    Not good. Now it does all the HTTP work in a background thread, so you can get on with other stuff while it tries to send your tweet.

  • SIP support
    This was asked for a lot. The Today screen doesn’t include the button to show/hide the on-screen stylus/finger keyboard. So if your mobile doesn’t have a keyboard, TwitToday wasn’t much use.

    I’ve added a setting now that lets you programmatically show the SIP keyboard when you tap on the text box.

If you want to try the new version, you can download it from here. If you want to see how I did it, read on.

(more…)

Over The Air… it’s all over

Sunday, April 6th, 2008

heading home from Over The Air with our BBC bean bagsHeading home from Over The Air with our BBC bean bags!

Over The Air is all over, and I’m back home again (in time for the first proper snow I’ve seen in years, but I digress… 🙂 ). Just time to jot down a few quick thoughts.

It was talks and presentations in the day, with a hackday competition in the evening.

(more…)

Mobile translation – an unfinished hack!

Saturday, April 5th, 2008

Fourth of the random ideas for Over The Air hacks – a mobile service that lets you translate foreign text that you come across from your mobile phone.

The plan was to:

  • reuse some old code from last year to control my cameraphone and take a picture
  • upload the image to LeadTools, using their OCR web service to get the text back from the picture
  • translate the text into English using the Google translate API web service
  • display the English text on the phone screen

Unfortunately, too much time spent drinking beer, listening to talks, and generally slacking, meant that I didn’t finish this one.

But I thought it still might be interesting to share my experiences with the LeadTools service.

(more…)