Reputation: 49
I'm developping an android cab booking app , My goal is that all registered users on the passenger app can see the location of all near by cabs in a realtime map ,when they click the cab marker they can see information about the cab , driver ,distance...then send a request to driver
the geolocalisation of the cabs must be done through the driver smartphones , the drivers have also their own app and they must be registered . for I made a registration system with PHP/MySQL, It't supposed after login into the app to show a map with current location in it (passenger's location) and all near by cabs. My question is how can I broadcast and show the registered drivers' locations to all registered passengers maps ??
Upvotes: 2
Views: 1303
Reputation: 2357
The driver apps should send their locations to the server and should be saved in mysql which are updated every certain period of time as you had chosen in your driver app using the method (onLocationChanged(Location location)).
When the passenger open his app it also sends his location to the server which will select for him the nearest drivers for instance the nearest five using (google distance matrix api) which you can call through your php server using curl . Also the location of passenger should be saved in database and updated in the same way to show to drivers .
Upvotes: 2