Sample source code for the blog post : http://goo.gl/dTlUcp