Push notifications for mobile apps

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.

Read the rest of this entry »

OAuth authentication from a mobile device

August 31st, 2009

I wrote a post a couple of weeks ago in which I whined about the difficulties in creating a good user experience for a mobile client that authenticates with an OAuth provider.

I was pleasantly surprised (and a little honoured!) to get a comment on the post from Chris Messina reminding me that the way to address the usability issue isn’t to revert back to using usernames and passwords, but for us to all work to improve the usability of OAuth.

Sufficiently inspired, I went back and had another go.

It’s still not quite there, but I think it’s better.

As Andy pointed out last time, not everyone has a Windows Mobile device to try my code on, so this time I tried recording a screen capture of it.

Read the rest of this entry »

(Another!) Mobile app to share where you are

August 29th, 2009

Mobile location sharing is something that I keep coming back to: from finding where my phone is using GPS, Bluetooth, WiFi Access Points, GSM Cell Ids, using my own hand-rolled systems or newer services like Google Latitude, dopplr, OpenCellID and Brightkite.

There is something about the promise of location-based apps which I find very exciting.

This is my excuse, at any rate, for sharing my latest bit of tinkering. 🙂

The stuff that I’ve tried so far has been focused on long-term sharing – apps intended to run in the background on your phone all the time, sharing your location with a pre-arranged list of friends and family who have signed up to the same service.

I’m playing with an app which comes at this from the other angle: an app for specific occasions to share your location. Not something to run in the background all the time, but an app to use when you want to let someone know where you are – a specific person. This could be a friend or family member, or a colleague or client (perhaps someone who hasn’t signed up to any service that you have).

Read the rest of this entry »

Accessing authenticated Google App Engine services from a .NET CF client

August 24th, 2009

Google App Engine (GAE) gives you an easy way to build and host web applications for free.

For any address you specify in your GAE app, you can require users to be authenticated. For example, if you have this in your app.yaml:

- url: /authme
  script: myAuthenticatedService.py
  login: required

When a user goes to http://yourapp.appspot.com/authme in their browser, they get taken first to a google.com logon page and promtped for their google username and password.

Only if they authenticate correctly will Google pass them back to your page, and let them access your /authme page.

(This is kinda nice, because as a GAE app developer, you shouldn’t need to see the user’s password. Although, I guess most users won’t make a distinction between typing in their username and password into the google.com login page and into a login form on an appspot.com page.)

If you are writing browser-delivered apps, this is all fine and works as described. This is slightly trickier if you are writing a web service that you want to be accessed by a client app. I wanted to access a GAE web service from a mobile client – this is how I’m doing it.

Read the rest of this entry »

Stripping out MIME headers

August 18th, 2009

A couple of years ago, I wrote a small plugin for Outlook Mobile (the version of Outlook that you get on Windows Mobile phones) to help me triage my emails.

The idea was to make it quicker to process my email from my phone, by adding a couple of context menu items to emails that let you create a new To Do item in Outlook Tasks, or a new diary entry in Outlook Calendar.

So if someone sends you an email asking you to do something, with one tap you can create a new To Do list item, pre-filling it with information from the email.

And if someone sends you an email about an event or meeting you need to go to, with one tap you can create a new Calendar item, prefilling it with information from the email.

Read the rest of this entry »

Where did your electricity come from?

August 17th, 2009

Where did my electricity come from?It’s been a while since I posted about CurrentCost stuff, so time to share another little idea.

Last night I made a start on adding a new graph type to my CurrentCost application.

Instead of only displaying how much electricity you’ve used, the new graph displays the split of how that electricity was generated.

Realtime figures for the “energy mix” of ratios of different generation methods used in the UK National Grid are available in an XML feed that updates every five minutes.

Read the rest of this entry »

Pub/Sub for Child Protection

August 15th, 2009

I went on a training course yesterday to learn more about the Independent Safeguarding Authority (ISA). ISA is the public body that will be responsible for registering and vetting people who work with children. It was created by the Government in response to the Bichard Inquiry that followed the Soham Murders.

There was way too much covered in the course to fit in a single post, but there was one particular bit worth mentioning.

The biggest limitation with the existing CRB (Criminal Records Bureau) checks is that it’s a snapshot – a one-off check.

It’s a piece of paper that tells you that the owner had no convictions at the time the paper was printed. But it doesn’t tell you if the owner went out and committed a crime the day after the paper was printed. If a CRB check isn’t repeated for a few years, it can be years before this is discovered.

ISA registration is different. Once registered, someone is continually monitored.

Read the rest of this entry »

Authenticating with an OAuth 1.0a provider from .NET CF

August 14th, 2009

Last night, I shared my first stab at a mobile Fire Eagle client: a Windows Mobile application which posts location updates to the Yahoo! Fire Eagle service.

A couple of the bits of code were fiddly, and are worth sharing.

In this post, I’ll outline how I perform the code behind the OAuth authentication I described in my last post. Hopefully, this might help anyone else wanting to do something similar.


Read the rest of this entry »