frogEye
frogEye

Reputation: 364

Real Time Tracking in Android App

How does app like Uber do real time tracking of Cabs? Let me put it across in detail:-

  1. Cabs Position to the server.
  2. Server then communicates that positionto the another user app which is trying to book a Cab.

I have gone through many blogs, after that I could think of the solution below to solve the 2 issues:

  1. Cabs will communicate there lat/long to server after some time gap using http request.
  2. The user app will establish a socket with the server and any change in the server will be communicated to the user app through that socket.

Is there a better way to do it? Please give your insight about the issue.

Upvotes: 1

Views: 5589

Answers (3)

Deric Lima
Deric Lima

Reputation: 2092

I have the same issue here for my app, where drivers send their locations in a MySQL table in a server.I think the best way to do this is WebSockets, to create a connection between the server and client and send the new location everytime when changed. I really don't know if is the best approach but i will try to do this, maybe can help you also. I'm using PHP so i will try with Ratchet:

Ratchet PHP

Upvotes: 0

Aniruddha K.M
Aniruddha K.M

Reputation: 7511

i think each cab will be fitted with a GPS tracker(could be mobile based app also NOT SURE) to track and send real time data, once the location data changes a TCP connection established will be used to communicate.

Upvotes: 0

Abad
Abad

Reputation: 55

I think cabs do not communicate to the server or vice versa, until there is some client/passenger who pin his location and destination. The request of client is sent to the server, then server looks for the cab that is closer to the client/passenger. There is quite possibility that they are using GCM Google Cloud Messaging Service of google.

Upvotes: -1

Related Questions