Geolocation without GPS

seba7 years ago

I have the client set up on the Samsung Xcover Galaxy 2 phone.
Geolocation works only with GPS on, even thou I've set up mixed mode.
In other apps it works witohut GPS.

I tried moving into nearby town, so that it would force some mobile tower/WiFi switch and it didn't work. I have mobile data turned of course.

Anton Tananaev7 years ago

If you want to use network location, I would recommend setting provider to "network". What do you mean by turned off GPS? Please provide a screenshot on how you disable it.

seba7 years ago

Yes, if I set Network (with or without GPS off) or Mixed (with GPS off), then I don't get any location update.

I turn off GPS by sliding down on top of screen (not in the APP), where you get Wi-Fi, GPS, ... and I turn off the GPS.

So it only works with Location provider being set to GPS or Mixed and having GPS on. I've seen a similiar bug in some other phones.

Anton Tananaev7 years ago

Please provide a screenshot. Usually when you turn off location in the notification area it turns off all location providers, including network!!!

seba7 years ago

Yes OK, but if I set everything to work for "GPS provider" (and that it works) and then switch to "Network" in Traccar, i.e. not turning anything off (like GPS), it doesn't work: no location updates.
I was turning off the GPS here

but as I've said if I let it on here in the screenshot and just switch in Traccar to Network it still doesn't work.

Anton Tananaev7 years ago

That button usually disables everything. Even though it says "GPS".

Traccar gets location updates directly from Android system. If you don't get a network location, it means that your phone can't get it or there is some misconfiguration (e.g. no permissions).

seba7 years ago

It doesn't disable all location services. If I go to Google Maps app (or others) it correctly finds the location via WiFi/Network. Even if I turn on Traccar (in Network location provider mode) and in paralel I use other apps, the other apps get the location, but Traccar doesn't.
So if Traccar doesn't get permissions is because it didn't request them, I presume.

Anton Tananaev7 years ago

OK, enable that GPS button, switch to network provider in the app, start service, wait and tell me what you see on the status screen.

If your phone runs Android 6.0+, you should also check permissions for the app in the app manager.

seba7 years ago

Two events. Service made, Connectivity change and that's all.

I have Android 4.1.2, phone GT-S7710. I have my phone rooted, if that helps and/or is relevant.

Anton Tananaev7 years ago

If there are no "location update" messages on the status screen it means that device can't get a location.

Android 4.1.2 doesn't support runtime permissions, so it's not a permissions problem.

Google Maps can use last known location, so if you see your location there, it doesn't mean it's working.

seba7 years ago

I've tried having GPS off all the time, but having mobile data and WiFi on, from leaving home to near by town. There I've opened Google Maps, it correctly found my location using non-GPS means.
Of course Traccar didn't get a location.

Anton Tananaev7 years ago

I have already explained that Traccar Client request location directly using Android API. I have no idea why it doesn't work for you and works for everyone else. I would need to take a look myself to understand what's happening.

seba7 years ago

Yes, it's OK. Think of it as a possible bug report. I'm not pissed or anything, I like the app, just trying to help it improve.

I only wanted to test if that part it's true, where you've said disabling the GPS via that button, disables all location services. It doesn't.

Anton Tananaev7 years ago

On most phones it does. On official version of Android it does. Not sure about Samsung. I will try one of the Samsung devices at when I get back.

dsm7 years ago

I have the same issue, but I dont think it has something todo with the Traccar Client. Other Apps that try to get the location via wifi/gsm also dont work. I am using a Leagoo Elite 1 with Android 5.1

There are 2 APIs to get a location on an Android device. I dont know which API is used in the Traccar Client. (https://developer.android.com/training/location/index.html)