How do I get my location?

hello every one
can i know how program get my location when start my program then get location driver continuously ?

You have a huge amount of tutorials, examples and others here:

Search results for 'Location #tutorials-and-guides' - MIT App Inventor Community

i know that but my question is which block can use to read Latitude and Longitude driver in firebase after saving in firebase every second

how are you storing those values in firebase?

when location sensor changed store Latitude and Longitude in firebase
this for driver
but i need read Latitude and Longitude for students who wating bus at home every second
because when location sensor changed block is not good because the location of Student not changed as driver because driver is moving

Then you can use the GetValue block....

You have other possibilities with web component and firebase:

i used get value but at which event can use it

I don't think any location sensor updates the position every second... every minute maybe?

there is one second in location sensor tool my app can save Latitude and Longitude every second when bus moving using when location sensor changed

I don't understand....if you already have the Lat and Long from the sensor (because you are storing them), why do you need to read them from firebase?

look i have app for waiting bus for students
the bus is going to students house
the student wating bus and see the Google map with direct location of bus

And the bus app store its location, and the students apps read the location stored....and what is your problem? To read data stored in firebase? you can do it with GetValue or with the Web component

i need to get value for students every second that wating at home not moving

why every second? you can read the values in 20-30 seconds interval...you set a clock with that interval, when it fires you get the values from firebase.

1 Like

Impossible as Ramon indicates. the LocationSensor does not update every second (location sensor tutorial) explains how the gps works Have you read it an tried the tutorials in the link?

Have you tried How to broadcast a GPS location and share the information on a map with others in real time..CloudDB .

The example uses the CloudDB component. It is easily converted to using the FirebaseDB component.

1 Like

You could try this method:

It may be better to report a change in location, than to try to get location every second.

Expecting a data turnaround every second is a bit too much for location getting and firebase. Lower your expectations, perhaps every 10 or 15 seconds