This code was produced following a tutorial from Learnable.com on Android.