I'm making an application that collects timestamp and GPS data from a user's phone in intervals along with some other information.

Currently, every tuple generated is sent via TCP to my application server as soon as the tuple is generated.

Is this an unconventional way of transmitting data considering it could transmit data multiple times per minute? I'm concerned about the device's resources such as battery and data plan consumption, etc. Transmission is mostly via cellular networks or WIFI.

It is important that the server receives real-time or near real-time information so I don't see any other way of doing this.

Any insight?

  • How accurate is your GPS receiver? How fast do you expect the device to be moving? Have you written a test program? Just transmit bogus data (with the correct number of bytes) to the server as fast as you think you'll need, then monitor battery life and temperature. Apr 24, 2017 at 21:34
  • 1
    In addition to thinking about how much to send also consider batching relatively small location changes and even ignoring really tiny or equal gps locations maybe. May 2, 2017 at 13:34

1 Answer 1


If it absolutely needs to be real-time (or as close to it as possible) then maybe this is the best thing you can do.

If you are OK with close to real-time you could save up a few messages, and then send them in a single digest-message to the server. Each sub-message would of course include the time-stamp that shows when it was generated so the server could still put them into the correct chronological sequence. Then, every n seconds (you'll have to determine the optimal value for n), you send a digest message. This way, instead of sending messages 10 times per minute, you might only send 2 or 3 times per minute, saving the battery of the transmitting device.

Of course, if this is the sort of situation where lives might depend on fast responses from the server, this approach might not be good enough. Also, I have no idea how much extra battery energy the extra transmissions might use vs. a single (but necessarily longer) transmission. This would probably require some actual experimentation.

  • Interesting, I will look into that, thanks. No its not a health monitoring application. Yes I need a way to handle the order the messages arrives in at my server.
    – carva
    Apr 24, 2017 at 22:09

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.