traccar-client-android
traccar-client-android copied to clipboard
Improvement
Added the report interval to the report in order to detect if the client has lost connection
Can you please explain the use case.
@tananaev When the device sends a report, the device sends its report interval so the sever knows when to excpect the next report. If the server doesn't get the report in that time (+some buffer) I know that the device went offline due to some reason (i.e. turned off or lost reception).
Are you planning to implement some modifications on the server side as well? What about iOS?
Maybe not right now, but possible to do that in the near future. What do you think about that? Do you have any alternative to detect a GPS / Android loosing connection?
OK, we can merge when everything is ready. Also, the right way of implementing this would be to add a new parameter to the Position
model. One more thing I suggest is renaming parameter to something shorter (e.g. "interval").
I'm not sure if that's correct, the interval isn't really a part of the Position model attributes (logically). Just because we want to send it to the sever doesn't mean it has to be a part of the model. The attribute name can definitely be changed. And OK, we'll wait until all platforms are aligned.
I think it makes sense to send original interval value at the time when location was captured.
If you think this is the best approach we can do that, but I'm not sure that's the right way logically. I'll keep you posted on the other platforms so we can merge everything at the same time.
What exactly do I need to change in the server?
We can either keep server as it is, but ideally we want to use interval for "unknown" status timeout.
Ok, I'll keep you updated. Thanks.
I like this idea, and would find it useful.
@slobglob @garyvdm https://github.com/traccar/traccar-client-android/pull/348 implements this and more, if you want to try, feedback welcome.