A modified version of Appcelerator's Alloy sample.