if you want to track a phone, how would you do it? - best practice

You must Login before you can answer or comment on any questions.

I want to track the real time movement of a car. Should I get it's position, send it to the server, and immediately get the position again and so on? What would be your recommendation as a best practice?

— asked 9 months ago by Ryan popa
0 Comments

3 Answers

I would not send it to your server everytime it was updated. Personally, I would save the data locally, via local database, or an array, and send them at specific intervals (every 5 minutes or once the array hit 100 elements, etc).

— answered 9 months ago by Troy Steuwer
answer permalink
1 Comment
  • what would be the disadvantage of sending the location each time? I would like to see the current location at each particular time. Do you consider sending as a huge overhead?

    — commented 9 months ago by Ryan popa

Its usually best to grab the location at intervals like 30 - 60 seconds due to battery consumption. Don't try to make it run forever in the background for the same reason.

there is an event you can listen to.. it is called something like 'significatlocationchanged'. It will be implement in the next sdk update.

Your Answer

Think you can help? Login to answer this question!