Comments (11)
It sounds fine.
Thanks @mendhak for helpful insight!
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.
This will however have to wait, because I am terribly busy now, sorry :(
from ulogger-android.
Thanks for considering this !
from ulogger-android.
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.
from ulogger-android.
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 ;)
On the other hand we could just subscribe to low battery broadcasts. Then we could only log two states: battery low and battery ok. Would it be useful? I'am not convinced.
from ulogger-android.
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?
from ulogger-android.
This is how I understand it. Read here:
Generally speaking, the impact of constantly monitoring the battery level has a greater impact on the battery than your app's normal behavior, so it's good practice to only monitor significant changes in battery level—specifically when the device enters or exits a low battery state.
And monitoring significant changes means monitoring two states: ACTION_BATTERY_LOW and ACTION_BATTERY_OKAY.
from ulogger-android.
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.
from ulogger-android.
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.
public static int getBatteryLevel(Context context) {
Intent batteryIntent = context.registerReceiver(null, new IntentFilter(Intent.ACTION_BATTERY_CHANGED));
int level = batteryIntent != null ? batteryIntent.getIntExtra(BatteryManager.EXTRA_LEVEL, -1) : 0;
int scale = batteryIntent != null ? batteryIntent.getIntExtra(BatteryManager.EXTRA_SCALE, -1) : 0;
if (level == -1 || scale == -1) {
return 50;
}
return (int) (((float) level / (float) scale) * 100.0f);
}
from ulogger-android.
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 ?
from ulogger-android.
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.
from ulogger-android.
As for me, there is at least two usecases for this:
- When sending data to server: allow other people to guess why your phone suddenly turned off.
- When saving locally: allow you to estimate how specific settings affect battery life and tune them according to this data.
Both cases don't require frequent battery requests: 2..5 min interval is completely fine, as for me.
And this option could be disabled by default and enabled only by people who are ok to spend some extra power budget on it.
from ulogger-android.
Related Issues (20)
- Multiple user on a map HOT 1
- Automation not working properly on Android 13 HOT 3
- Not fetching location on Android 11 (Lineage 18) HOT 13
- Tracking doesn't resume after reboot HOT 3
- Automation idea: `start new logger if synchronized` command HOT 4
- Feature Request: interval for live synchronization
- geoid height correction is missing HOT 5
- Burst upload generates 503 on my server HOT 1
- Sudden HTTP Error code 500 with Nextcloud/PhoneTracker HOT 3
- Exception: OCA\PhoneTrack\Controller\LogController::logUlogger(): Argument #2 ($lat) must be of type float, null given HOT 1
- mutual tls with client certificate [feature request] HOT 1
- Cannot upload location with images HTTP error 400 HOT 11
- Sotimes Upload getting 406 error HOT 1
- Reduce POST length in image Upload
- (dulicate due to network lag)Manual waypoint creation by external request?
- Manual waypoint creation by external request? HOT 1
- Can't download app via F-Droid HOT 5
- Week Rollover Problem persist HOT 1
- Number suffix for overwritten file appends to extension HOT 1
- Feature request: Use as a replacemrent for google location history
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from ulogger-android.