Please help me in this project (track a bus location and show it on a Map)

Uh oh. An app like this

  • is made using a common map screen. You use an ActivityStarter to provide a map. Using an AS Google map ordinarily is a good idea. When you switch screens, it is not. I would use the Map component. Can the AS map be used successfully like you are trying? Sorry, I don't know, never tried.

  • constantly sending a location is possible provided what you mean by constantly. The LocationSensor/gps requires somewhere between 20 to 30 seconds to achieve a satellite fix to determine where the Android is located. Update more frequently and you will have issues; especially because you are using the CloudDB and it takes time to update the shared database . Your app is presently using a TimeInterval of 10000 ms (10 seconds); entirely impractical and doomed to failure. Try 30000 ms.

  • an alternative to using a CloudDB is to use a Web component with a Google sheet. Is it better? In some ways but certainly is more difficult to code.

  • if your goal is to track the whereabouts of the bus, this app can be very simple. If you attempt to track the whereabouts of individual students, it becomes a complex exercise.

I'll look to see of I can find an example showing a simple way to show a 'common' map using the CloudDB. It might take a while. I will try to post something in the next few hours.

The following examples do some things similar to what you seem to want to do. Both of them use a single Screen.

This example shows how to use the Map component and the LocationSensor to display a map.

This example uses a locationsensor, map and CloudDB

Hope you make your deadline. :wink:

Here is an excellet tutorial by Romin showing how to work with bus routes using FirebaseDB.
https://rominirani.com/tutorial-mit-app-inventor-firebase-4be95051c325 It can be duplicated for use in a CloudDB by substituting the Firebase control blocks with the CloudDB comparable blocks

Regards,
Steve

1 Like