My project requires that an android application be able to collect accelerometer and gyroscope data and perform some calculations. It works while the screen is on, but as soon as the screen turns off, all data stops printing in my logcat.
I've read the "Best Practices for Accessing and Using Sensors" in the android documentation (https://developer.android.com/guide/topics/sensors/sensors_overview#sensors-practices). I know of the WakeLock solution. I was wondering if a solution exist where I can still collect data and perform calculations while the screen is off - not use the WakeLock solution. I've looked into services but I don't know if it will work.