traccar-client-android
traccar-client-android copied to clipboard
[v5.17] Issue #367 (not sending location updates) is not fixed
Just tested v5.17 and confirm that sending locations only works when:
- GPS is turned ON: it still doesn't work when using mobile network, wifi or bluetooth.
- Accuracy is set to High. Medium and Low settings, even with GPS turned ON, result in no locations being sent.
Issue #367.
Which version have you tested? APK or one from Google Play?
same for me using the APK from f-droid (no google play on my devices)
There are no changes if you are using APK. The idea is to use Google location provider if it's available, but on f-droid we still use standard Android location APIs.
@tananaev I used the one from Google
Just tested:
- Accuracy high - no GPS signal - works
- Accuracy medium - works
- Accuracy low - works
What exactly is not working?
Hi @tananaev, here's the report:
Brand / model: Sony / Xperia X Compact
OS: Android / 8.0.0
Client: 5.17
Flavor:
- [x] Google Play store
- [ ] F-Droid
- [ ] Other APK:
Phone settings:
- High accuracy: GPS, mobile network, Wi-Fi and Bluetooth
- Battery saving: Mobile network, Wi-Fi and Bluetooth
- GPS only (one can expect the same results as 1.)
Traccar settings:
- High
- Medium
- Low
Results:
High | Medium | Low | |
---|---|---|---|
Phone: High accuracy | :heavy_check_mark: | :x: | :heavy_check_mark: |
Battery saving | :x: | :x: | :x: |
GPS only | :heavy_check_mark: | :x: | :heavy_check_mark: |
Additional notes:
Tests were run in the open-air, device in motion with settings:
- Update frequency: 1s
- Minimal distance: 0
- Minimal angle: 0
Have you enabled network location provider on your phone? When you first set up your phone, it asks you if you consent to it.
I have tested all 3 modes with high accuracy (Android settings) and all of them work fine.
I don't see any option to enable/disable network location provider, so I'd say it is enabled. Also, have never been asked (even on first set up) if I would want to disable it, and have no reason for doing so. In the past (v5.12 IIRC) it worked.
Simply put, it doesn't work anymore for all versions later than removal of Lost API.
Every Android phone I ever had asked consent for using network location. If you don't enable it during setup, I'm not sure if there is a way to enable it later.
Don't see why I would have disabled it. What was the last version using Lost API ?
Don't remember now. Check git log on the gradle file to see when it was removed.
Looks like it was removed in 5.12, so I'd need to test 5.11 again. Unfortunately the release asset from github won't install.
What is the error? It should install just fine. Make sure you remove the app first, if you already have it installed.
I uninstalled it first.
Sorry for jumping in, but I have to agree with @oliv3 v5.17 is not working. Previous version(s) worked fine. Unfortunately all my clients updated automatically to this version.
After playing around with it for the last hours I found this thread and tried changing accuracy to high - and here we go, client sends as expected. If I could help with debugging, testing or whatever - I'll be there...
Try to get system logs. On my Pixel 3 XL all accuracy options work just fine without any issues.
thanks for your quick reply and sorry for my late one, was quite busy today. I just connected my PRIV but cannot find any logs for traccar - do you have an idea where I can find them?
What is PRIV? You need to use ADB to extract logs from Android device.
Blackberry PRIV (running Android 6.0.1), I'll check that with ADB, but will be earliest on Thursday. I'll mention my results here...
@normic, @landryb: Feel free to report what's not working using this repository. Just send a PR or open an issue so that I can update it accordingly.
@tananaev: FWIW, I'm also using Nextcloud PhoneTrack, which works for me with "Network only" setting.
From your comments, I read that Traccar client works well if and only if you are using:
- a Google-based OS
- with Google Services enabled
- on a Google-made phone
Or did I miss something ?
I only have Google phone at the moment, so I haven't tested on anything else. I have tested on emulator, but it only supports GPS location.
Hello @oliv3 @tananaev
I would like to draw your intention on following limits imposed by Android OS itself on every devices starting from Android Oreo and above.
Background Service Limitations: While an app is idle, there are limits to its use of background services. This does not apply to foreground services, which are more noticeable to the user.
Broadcast Limitations: With limited exceptions, apps cannot use their manifest to register for implicit broadcasts. They can still register for these broadcasts at runtime, and they can use the manifest to register for explicit broadcasts targeted specifically at their app.
In an effort to reduce power consumption, Android 8.0 (API level 26) limits how frequently background apps can retrieve the user's current location. Apps can receive location updates only a few times each hour.
I want you guys to consider Schedule tasks with WorkManager
The WorkManager API makes it easy to schedule deferrable, asynchronous tasks that are expected to run even if the app exits or device restarts.
Key features:
Backwards compatible up to API 14
Uses JobScheduler on devices with API 23+
Uses a combination of BroadcastReceiver + AlarmManager on devices with API 14-22
Add work constraints like network availability or battery
Schedule asynchronous one-off or periodic tasks
Monitor and manage scheduled tasks
Chain tasks together
Guarantees task execution, even if the app or device restarts
I have notice we are [in this repository] using BroadcastReceiver
+ AlarmManager
explicitly in our code. It's worth considering to use WorkManager API
for location tracking.
I want your feedback / thoughts on this approach for supporting new devices which are yet to come.
Related links.
- https://stackoverflow.com/questions/53064077/android-oreo-and-above-whats-the-best-way-to-get-location-when-app-is-not-runni
- Guide to background processing
Thanks
@kasim1011, I would like to draw your attention to the following sentence that you quoted:
This does not apply to foreground services, which are more noticeable to the user.
Which basically makes rest of your comment irrelevant to the situation with Traccar Client.
Traccar Client uses foreground service mode with a notification that is visible to the user.
I have exact the same problem with my Samsung S2, in the past it worked fine, but for a few weeks it doesnt send "position update", in the log it only shows " network online", thats it. After reading this, and changing accuracy to "high" its sending now again. With a newer phone e.g. Samsung A5 there was no problem!
I have exact the same problem with my Samsung S2, in the past it worked fine, but for a few weeks it doesnt send "position update", in the log it only shows " network online", thats it. After reading this, and changing accuracy to "high" its sending now again. With a newer phone e.g. Samsung A5 there was no problem!
I have to correct me, its still showing, that Traccar is online, but doesnt send GPS datas to Server. With newer Android Phone its not a problem.....
This happened to me on a Huawei device and it happened to be Privacy Guard. Took me a while to figure it out. Coarse Location was set to "Always Ask" but there was no prompt in the phone. Changing to allowed fixed the issue. This is beside the point of Allowing location request when starting the app. (Yes it was allowed)