Server-side code from the example shown in our talk at Mobile World Centre, for Barcelona Android User Group's May 2014 meetup