some source code:

https://github.com/mdeejay
Follow me -> http://twitter.com/#!/mdeejay_ru
HTC One / ZTE Grand S / Nexus 5