-
Notifications
You must be signed in to change notification settings - Fork 55
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Battery status integration #15
Comments
If we wanted to have updated battery status every time we log position it would mean using more resources. We would have to use more battery in order to get battery status ;) |
In fact battery status is usable in case we are getting positions periodically. It will be good feature to allow tracking periodically without the need of GPS sensor to be always on. What you think? |
Do you really think getting the phone's battery status each time the app logs a position is battery consuming ? I would say that it just reads the information provided by Android API which must not cost a lot. I would love to have that information sent with each position ! BTW : thanks for this great app. |
This is how I understand it. Read here:
And monitoring significant changes means monitoring two states: ACTION_BATTERY_LOW and ACTION_BATTERY_OKAY. |
I thought the battery status was stored somewhere by the system and that accessing it had a very low cost... Just like accessing the device name 😉. I mean, it should not be costly. GpsLogger, which is very battery-saving-oriented, gets the battery level for each logged point. I'll ask the dev what he thinks about that topic. |
It's a sticky broadcast, so yep it does become expensive if it's being queried frequently. The way I've done it is here - no application level receivers, just that method and which by default gets called once a minute. From testing that's had no adverse effect on battery life. So if you were to do this, it's worth setting some kind of a minimum time between these requests.
|
To make it short : the battery level could be stored by the app and updated every minute (or even 10 minutes). This stored value would be sent with each logged point. This way, there are not too many accesses to system battery level but a relatively precise value is sent to the server. What do you think about that @bfabiszewski ? |
It sounds fine. Personally I don't need such feature, but I think I could add it as an optional thing, allowing user to select additional extra data that is logged. |
Thanks for considering this ! |
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions. |
As for me, there is at least two usecases for this:
Both cases don't require frequent battery requests: 2..5 min interval is completely fine, as for me. |
Is it possible to get battery status and send it to server?
The text was updated successfully, but these errors were encountered: