Client-Server between APP that tracks real-time location

1

Hello, we have an app that sends the location of users to the server every 15 seconds. Currently it's a simple (lat / lng) POST in the API, would there be a better way to do this?

Any specific architecture?

    
asked by anonymous 08.08.2018 / 04:04

1 answer

1

I do not think there is a specific architecture for this, I'll just make some recommendations.

It is interesting to save positions within a table in SQLite within the app itself for times when there is no internet available and download them to the server when there is. This is called buffering. I suggest the following procedure:

Every 15 seconds:

  • Capture a position;
  • Save to table;
  • If there is Internet, make a select by bringing the (say) fifty last positions and tries to send them to the server.

Warning for the capture date-time, it is different from the date-time of sending and the date-time of the arrival on the server. It might be interesting for you to treat these values as different things.

Moreover, the approach seems ok.

Consider saving as much information as you can about each position (date-time, lat, lng, altitude, speed, direction, IMEI or other device identifier, etc.). >

If the number of users grows too large, you may need to be careful about the upload frequency so as not to overload the server (reduce to a time interval of between one and five minutes, for example).

    
08.08.2018 / 16:32