it was edited to allow the app to run in background to poll accelerometer even when the screen is off.
(Note : Compatibility of this app is unknown, it currently being tested on Nexus 4)