Code from the example shown in our talk at Mobile World Centre, Barcelona Android User Group, May 2014