Google Gears Mobile Location API

I’ve had a quick chance to check out Google’s new location tracking API in Google Gears for Windows Mobile phones. At first glance I say this is an absolutely awesome new feature.

My first point of call is to find out if any social networking sites (e.g. Brightkite) are interested in using this to create a great mobile web interface for Windows Mobile devices.

Intercepting SMS messages for Jaiku

New SMS notification: “nicholasclarke: A crazy week of work coming up! Never a good thing.”

Combine that with ability to intercept text messages into my own application on my phone, this basically means I can write a Jaiku application which keeps track of everyone’s Jaikus but doesn’t interfere in my day by beeping and flashing at me 24/7.

In theory, this means I could write a Windows Mobile Jaiku client that stays off GPRS.

Weekend roundup

Scouts on the night hike in reflective jacketsScouts night hike

Our Scouts came joint 7th out of 17 groups from around the district on the night hike on Friday. This is pretty surprising, since we had to rush back by skipping 2 bases with a shortcut. It turns out that very few teams went to all 10 bases, with one team only managing 6. My legs have recovered now, but my sleeping pattern is still a bit off.

Prawns in tikka masala sauce with pilau rice

In an attempt to expand my cooking abilities, I bought a bunch of spices and checked out a recipe for pilau rice. I’m very slowly working on becoming a better cook. Perhaps the next part is making the sauce by myself too – as I’m pretty unlikely to go catch my own prawns.

GSM stumbler failed

My attempts at making my GSM stumbler application run while my phone is sleeping has not gone well. The latest version doesn’t seem to pick up any changes of cell tower at all while the phone is off, and takes a pretty long time to discover that I’ve moved. I’ll have to look into this again.

Discovering background threads on Windows Mobile

This isn’t actually all that amazing to anyone that already knows how to use the .Net Compact Framework on Windows Mobile devices. It’s interesting to me because I’m only recently started on application programming, let alone creating applications for my phone.

My discovery this evening is that it is incredibly simple to make my phone run C# code while it is in sleep mode, by just using threading. This opens up quite a few ideas for me which help me progress towards a better Jaiku-like client for my phone:

  1. I can send “Keep-Alive” packets at regular intervals to make sure my XMPP connection to Jabber didn’t time out.
  2. I can automatically find out the current cell tower I’m connected to at regular intervals – and possibly also send these straight to Jaiku and the web by SMS/GPRS. (Update: this is now implemented in my GSM Stumbler application)
  3. I can scan for nearby bluetooth devices and wireless networks throughout the day.

All that while my phone is looking harmless and the screen is completely off, very handy:

ThreadStart starter = new ThreadStart(this.FindCurrentLocation);
Thread backgroundThread = new Thread(starter);
backgroundThread.Start();

Tracking my phone on Google Earth

After looking through various KML samples on the web during lunch today, I spent a little time experimenting with converting my existing location data into something that Google Earth could read – allowing people to track my location in real time.

Manual labour

About 6 times per day, I press a button on my phone and it sends a text message to my website with my current cell tower ID. My website then takes over and does all the smart stuff by itself. If I’ve traveled somewhere new, it automatically looks up the cell ID in a large UK database using their API to find the latitude and longitude of the cell tower I’m currently connected to. But big decimal numbers showing my current latitude and longitude aren’t all that interesting on their own.

Sidebar widget

The next step in my process was to add the widget on the side of my website to show everyone my current location. It’s not particularly fascinating – either I’m in my home town, at work, or traveling somewhere in between. But I’ve just added something a little more interesting.

Google Earth

Whereas before the link on my current location just took you to the coordinates where I’m currently sat, it will now load up a KML file showing a nice picture of a man standing on my current location, and hopefully a number of little cell towers which will show where I’ve been over the last 7 days.

The historic data isn’t all that interesting in Google Maps, but if I open up my KML file in Google Earth then I expose the timeline controls and I can choose to see where I was at different times and even animate my location over time.

What’s next?

I’ve got a habit of always wanting to do more.  I’ve cleaned up my location database so I could add in other locations (i.e. not just cell towers) and try plotting even more data. I’d like to try the following:

  • Load up GPS data for any hikes I go on
  • Add a few key locations onto the map such as the Scout hut, my brother’s place in Canada, anything relevant to me
  • Add some kind of refresh so that it updates automatically when I’m on the move
  • Create some kind of JavScript timeline interface for Google Maps

Next Page »