carp-dk / carp-dk/carp.sensing-flutter
Manually triggering an event-based measure once
- Dominant language
- Dart
- Stars
- 84
- Forks
- 31
- Avg merge
- 1d 8h
- Merged PRs (30d)
- 6
Description
CARP now resumes sampling when the app restarts as part of the brand new release 0.40.0. This is a great (and much needed) feature as operating systems become more aggressive in killing apps that consume power in the background.
However, there is one component missing to bridge the gap of missing data: triggering event-based measures only once. For example, instead of waiting for a change in screen state to come in after the app has been killed and restarted, it would be useful to know what the current screen state is. In the case of screen states, I suppose one could infer this because each screen off event must be followed by a screen on event, but this is not the case for all sensors. Thus, manually requesting the current state of event-based sensors - rather than resuming sampling and waiting for a new event - may be advantageous for minimising data gaps.
Now, I am not sure how feasible this is for all sensors, as the underlying API in some cases is truly event-based, but I believe it is feasible in most cases. Activity recognition and screen state are of particular interest because, unlike other event-based sensors, these do not immediately sample when resumed. For the other event-based sensors, a workaround would be to create a very brief periodic measurement so that they are only triggered once, but I believe a more appropriate solution would be preferable.
Contributor guide
No contributing guide indexed for this repository
Assessment
This issue has not been assessed yet.