Location Tracker

Hi,
How to retrieve location data such latitude and longitude from firebase database and display it in an app?
And how to do a direction button from the location retrieved from database to current location of the phone?

Use the Map component.

And how to do a direction button from the location retrieved from database to current location of the phone?

You can use the Navigate component.

This is what I have done so far...Im stucked here :frowning: would be great if you could help me.


You can plot the route several ways. You chose using the ActivityStarter.

  • A way to use the ActivityStarter to display a route to and from specific locations is like this:

and it might give you the result you want. Does it?

Edit: the line in the Action block should be http://maps.google.com/maps? and the next line should not have the :w in it.

You can use the LocationSensor1.Latitude/Longitude as you attempted instead of the fixed location shown by using a join Block. The Text block separating the coordinates from the LocationSensor should NOT be empty, the Text block should have a comma in it.
Experiment with the example code and let us know how it works for you.

Merry Christmas, Wesołych Świąt, Feliz Navidad, God Jul, Joyeux Noel, Καλά Χριστούγεννα, Happy Christmas, Veseloho Rizdva, Prettige Kerstdagen, Frohe Weihnachten!, 성탄 축하 , Buon Natale, 聖誕快樂 , 圣诞快乐, Sretan Božić, C рождеством!, عيد ميلاد مجيد

When i click "device's current location", i want it to show the latitude and longitude from the firebase database.
When i click the "direction from my location to device" button, i want it straight switch to Google Maps which will show the direction from the location recorded in firebase database to my location(which is my phone)

You can use a latitude/longitude from the firebase database but the coordinates will not necessarily be your current location unless you provide code to post your location to the firebase database.

You want to use the ActivityStarter. Be aware, using it limits your display options. The following example assumes your coordinates in the firebase database are in New Orleans at 30,-90 . Adjust these coordinates per your database. Button24 posts New Orleans; Button24 will post directions from New Orleans to your phone (assuming you are in North America).

Your posted image shows a Map component in your app. You can post a location using the Map component in your app. The Map and Marker will place the map on OpenStreetMap tiles (not Google Map tiles). Place a Marker component on the Map, then use this block

MarkerSetLocation
to enter the coordinates from firebase. Remember to center the map.

Alternatively use the ActivityStarter code shown for Button23 which will use GoogleMaps to display a 'direction' ... you do mean directions from one location to another or do you mean you want to show an arrow pointing to the other location?

There are many other ways to display a map and a route. You might want to do something similar using the GoogleMap api and the WebViewer.

I have connected gps module(installed in air conditioner to prevent theft) with the real time database that keeps updating the current location. So how do i display it in my mit app?

I want directions from the location of the air conditioner(which is from the firebase database) to my place.

can you explain call clearAS activity when button 23 clicked?

Resets the ActivityStarter1 Blocks. It is a Procedure I made that I should have provided the code. Here it is.
clearAS

I do not know. You made a post earlier that described what you really intend to do IoT Based Anti-Theft System

Perhaps someone who has experience with Bluetooth or Arduino can explain how to connect your hardware.