traccar-client-android icon indicating copy to clipboard operation
traccar-client-android copied to clipboard

FR: use most recent location for alarm

Open Abyss777 opened this issue 7 years ago • 5 comments

In case service is not started and other programs that uses location was started long time ago, Android update GPS location rather rarely. In that case when client send alarm it uses GPS location, that might be outdated. I think it is important to send most recent location with SOS alarm.

I would suggest select most recent location (if both available) in this piece of code https://github.com/tananaev/traccar-client-android/blob/master/app/src/main/java/org/traccar/client/ShortcutActivity.java#L109

Abyss777 avatar Sep 18 '17 05:09 Abyss777

If location is enabled on the phone Android usually has reasonable up-to-date location, but I see your point.

tananaev avatar Sep 18 '17 05:09 tananaev

Android not always is able to get fresh GPS location. There are strange glasses in my office, no one device can fix GPS inside building. Because of that GPS fix on my phone will be outdated until I leave the office. If I click SOS shortcut, Traccar Client will send coordinates of some point of my trip to the work, but any navigation program shows my location very precisely. It is confusing.

Abyss777 avatar Sep 18 '17 05:09 Abyss777

The problem is that if you select GPS or mixed provider, Traccar Client tries to get last known GPS location which can be old in case you are indoors. Maybe we should check time on the location and use network provider if GPS is too old.

tananaev avatar Sep 18 '17 10:09 tananaev

Yes, this option, can help to not sent too old location. Just curious... GPS location are always older than Network, or not, or depends how frequently applications ask for locations?

Abyss777 avatar Sep 18 '17 10:09 Abyss777

Not really, I think it depends on various conditions. Network location is probably more commonly used by other apps, so it will be more recent. But if you run some GPS app (e.g. navigation), it's more likely that you will have GPS location more up-to-date than network.

tananaev avatar Sep 18 '17 11:09 tananaev