Posts Tagged ‘ota11’

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.


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.