can anyone help me to make that project working with the Firebase please?
i am saving the drivers locations in the firebase as follows,
thanks for @SteveJG he did his best with me indeed, i just want to make that project working with the updated locations saved in the firebase instead of the sorted location file
https://community.appinventor.mit.edu/uploads/short-url/3eDl7xbsZsHwNwFQfDRp1zGMWnF.aia
(see link to MIT's suggestion for using its FirebaseDB control > ) Brief introduction to cloud data and the FirebaseDB component - Google Docs The control is what I used.
Here is an unfinished project using the firebaseDB control
I've gone with about as far as I can. You are welcome to the aia.
Try it to see if the project does some of what you want to do. I use Lists in Firebase for the Drivers etc.
To start, the database is empty. To start it:
- load the aia
- Wait (at least 30 seconds or more) until the red location icon disappears (while LocationSensor is getting Passenger coordinates)
- Press Start button. this loads some temporary driver data to initially populate the database Drivers list.
- Press Find nearest Driver button to calculate which Driver is nearest the passenger
- Press AddDriver button ONCE. (this feature is still in development, clicking again will corrupt the DB because it will add another #3 driver) AGAIN The Driver number should change for each Driver. That is not coded yet.
- Then press Find Nearest Driver to calculate which Driver is nearest the passenger
- Then press Post All Driver Locations to post Run time Markers of all the Drivers (active and inactive)
Some explanation:
-
Hide ALL Markers removes the markers from the driver List and the Feature Collection; Use the button again to restore the markers to the FeatureCollection and the Map component map screen.
-
Toggle LV button works only after using Find nearest Driver button to show driver # and his/her distance with existing code; it will all display ALL the drivers in the LV using the alternate code blocks using the alternative disabled blocks in the event handler.
Several buttons are only for use during development.
- ClearDriversDB16, clears the Driver DB; to continue you have to press Start again.
Feature is used to clear the DB when you make mistakes
- Replace fbDB button to an empty List starts with an empty list; to further develop the feature you will have to follow directions in the Notifier.
- Create List of Drivers is some very early attempts at adding new drivers with each getting the next available driver number. It doesn't yet provide options for adding the driver's name (it adds Driver4, Driver 5 etc. See disabled Button17 code
This uber like app needs lots of features.
-
Project does not have a Driver item slot needed to add a time stamp when the driver updates his/her location. You can add it the way you want.
-
the Replace a driver latest coordinates button only changes drivers name to all upper case characters. Use it and you can demonstrate that the routine can replace driver information for individual drivers using the Lists replace item list block .
-
This unfinished version uses the FirebaseDB control posts and 3 fictitious
locations. At the moment you have to change/add driver NumberId numbers manually to add more Drivers. So far it would default to driver names like Driver4, Driver5 etc. -
Disabled code is provided that one day would provide ability to add drivers another way. Using the LView to pick out one existing Driver data set and modify it to replace what is there.
Use Button18 and Lisview to select and post to the Screen bar
(:
Good luck @mustafaalbasel . Explore or throw it away. I will delete this post in a week because the code is preliminary not well documented etc.. You may not want to use it.
Best wishes.
Steve
thanks so much, sure will check it