You need to learn to code to build your Uber like app. It is not possible to slightly mofify the CloudDB / Location Marker Tutorial. The tutorial uses routines and examples that can be used in the NEW app you code.
Here is what I suggest:
- build a test app that does not use a LocationSensor that will let you decide how you want to handle the different things you need to do in your app. If you do not initially use a LS you can make the basic parts more simply.
- I expect you will want to make an example of how you will handle drivers, customer, calculate distance to customer (routine of one way shown in tutorial), etc
-You might want to make a list or csv: like this:
1,Mustafa,11111111,42.36646,-71.11139\n
2,Ahmed,2222222222,42.35137,-71.11377\n
3,Abraham,3333333333,42.36957,-71.08035\n
4,Steve ,4444444444,42.36801,-71.11459
containing Marker Number, Name, phone number, home latitude, home longitude to place in driver's Marker nearest the customer or number of open seats available in the driver's vehicle and anything else the driver should share with the customer.
-
Here are some simple possibilities to handle drivers:
-
if you have a List of drivers (name, coordinates, availability, phone contact) in your firebase it is easy to determine which is the nearest available driver. Determine the nearest to the user (customer) and post only the nearest driver available as Marker1 to show the driver location on your map. Calculate either straight line distance between the customer and driver or more complexly using the Navigate tool to determine nearest driver. Straight line distance should be good in most instances and not significantly different than road driving distance.
-
alternatively post the Markers for all the drivers on the Map.
-
just determine the nearest available driver to the customer. Provide the customer with the drivers name, distance and phone number. You don't even have to have a map to provide the info the customer needs to identify.
-
it is possible to use circles on the map to show the distance of all the drivers available and various other schemes. Most other options will just use up more of your realtime database time to post fancy things on the Map.
When you get one part working save it as a separate project. Keep marking individual parts work, then combine them to make the app you want. To do that you will have to experiment.
This is a long holiday here. I am visiting with my grandchild so sorry I can't be more specific as programming is not what I expect to do for the next week through New Year.