traccar / traccar-client-android

Traccar Client for Android
https://www.traccar.org/client
Apache License 2.0
668 stars 741 forks source link

"High" accuracy drains battery and never reports, "medium" accuracy too inaccurate #385

Open Tyler-2 opened 6 years ago

Tyler-2 commented 6 years ago

For users of the Android client who are using it to track people with phones, obviously those phones spend a lot of time indoors. When indoors on high accuracy, Traccar's behavior seems to be to only use GPS. It will keep GPS on seemingly the entire time it is indoors, never getting a fix. This will drain the battery very quickly as well as not provide useful location data. Medium accuracy is only really useful in populated areas where there is sufficient wifi coverage to give semi-accurate location. And even in heavily populated areas it is sometimes unreliable.

I see two possible fixes for this: A. Have a timeout for a GPS fix. If it doesn't work, fall back to a "medium" fix until the next location update interval. B: Rather than high/medium/low implying a type of fix... provide a desired accuracy. If I can get a 100 meter or better fix with wifi, no need to try with GPS. Wifi fixes consume less battery and it's probably worth trying them in most cases, falling back to GPS if you end up with a "1.4 km" radius.

I think it is undesired behavior to have to choose high (which will drain batteries indoors very quickly, won't provide any location info indoors) and medium (which will work pretty well indoors, but often knowingly provide 1 mile or more of inaccuracy).

I understand Traccar is leveraging another library for location data, but that that library is poorly maintained.

tananaev commented 6 years ago

Traccar doesn't use third party library anymore. The reason is issues in the library and poor support. If you know alternatives, feel free to share.

oliv3 commented 6 years ago

Still, the algorithm could be improved, whichever the library.

oliv3 commented 6 years ago

Think of enhancing location updates frequency, adapted in real-time given circumstances, instead of using the basic API, which will work ok in lab cases.

oliv3 commented 6 years ago

@tananaev https://microg.org/ ?

tananaev commented 6 years ago

It's not a library that we can include. Also, it doesn't seem to be using standard Google geolocation available on the phone, so I don't think it's a good replacement.

Tyler-2 commented 6 years ago

MicroG is a replacement for proprietary Google services that I definitely encourage keeping compatibility for. Since I use it on my main phone.

@oliv3, it basically lets you do things like use a third party or on-phone database for Wifi location data so you don't send your location and nearby wifi's to Google etc. But it's something to be used by users, not so much developers. A summary of UnifiedNLP here: https://github.com/microg/android_packages_apps_UnifiedNlp

@tananaev, good news about not using the third party library anymore, but... bummer that there's not another project you can staple to instead of having to develop yourself or with the little bit of contribution I expect you get.

luke-jr commented 5 years ago

This is very much needed. This past trip, I went several hours, often including significant movement, with ZERO reports at all. When I manually switched it to medium, at least it gave me something, but annoyingly inaccurate even when High would have worked.

Alternatively, maybe switch back to the unmaintained library that used to be used? Maintained or not, at least it worked reasonably...

ghostrider95 commented 1 year ago

Is there something new to fix this problem?