My app simply need to detect any motion of the device while screen is off.
I know that accelerometer is used for this task but it don\'t work while screen is off in
Yes you can use accelerometer in the background or when screen is off
but you need to hold a WakeLock
[Link] to prevent the device from sleeping.
If you need to detect if the device is still or if it started moving again you might be interested in Recognizing the User's Current Activity from Google Services.