3 ms·
I think battery life is quite simple to solve for, actually. A common method to work through this, especially for earthquakes, is to only capture sensor data wh
by cryptoz 7y ago
I think battery life is quite simple to solve for, actually. A common method to work through this, especially for earthquakes, is to only capture sensor data when the phone is stationary and plugged in+charging. If the phone is moving or unplugged, no data needs to be gathered. Sure, this limits the quantity of data you can get in the short-term, but relaxes users long-term and keeps the app installed. Offering these settings as toggles also helps.
FWIW, I mostly work on barometers. New versions of Android lock down the sensor access so it cannot be done in the background; my solution is low-resolution data (15-minute intervals, rather than ideal 1-minute) and for user privacy, I can discard location data after summarizing pressure data into gridded anonymous areas.
I do this in All Clear Weather: https://play.google.com/store/apps/details?id=com.allclearweather.android https://play.google.com/store/apps/details?id=com.allclearwe... (US, Android)
Sensor code: https://github.com/JacobSheehy/AllClearSensorLibrary https://github.com/JacobSheehy/AllClearSensorLibrary
I am also interested in gathering magnetic data, and presently also collect temperature, light sensor and humidity from phones that have it. I believe all this data could be useful for weather prediction, which is my current target.
But earthquake alerts, magnetic field/solar storm warnings, sound pollution (microphone), and various other distributed sensor networks should also be possible.
I have not noticed any battery degradation or over-use of resources in my dealings with sensors. As long as the developer takes care in the code and respects users' wishes, I think it's totally doable.