Rationale: How does a friend localization app work?

Asked

Viewed 579 times

2

I am studying mobile development and painted me a question: how works an app that locates friends on the map in real time?

Example: An app that shows on the map where your friends are who also has the app, distance where they are and location on the map.

The app sends the data of each to the server and this updates this data from time to time? Run in background? I would like to understand this logic of operation.

Hugs!

1 answer

3


By and large:

  • The app collects from time to time via Geolocation API the coordinates of all users, and sends the result to a central server. Implementations may vary, but in general a service is used for collection.
  • When you access the app this makes a request to the server - send me the current coordinates of users A, B, C, ..., Z, as well as their relative distances to mine.
  • But then when the user enters the app, and it asks for the coordinates, the server picks up the last stored location of the friends. It keeps running in the background on friends' devices (to send the data in these ranges)?

  • @user3776181 Exactly. From time to time the service installed on friends' mobile gets a new set of coordinates, and sends the result to the central server.

  • Example of implementation: http://android-developers.blogspot.com/2011/06/deep-dive-into-location.html

  • I have no experience with Android/Java, I am programming through Phonegap. But looking at the code that went from example, you can understand how the system works! = D Thank you very much!

  • @user3776181 Always a pleasure to help!

Browser other questions tagged

You are not signed in. Login or sign up in order to post.