Delivery app with location tracking

Hello,

A company wants me to develop a delivery app with location tracking. This particular app am going to add marker from json string which I can do, but the issue I think I will face is how can I store the latitude and longitude of different deliverers without contradicting each other.
How can I store and retrieve the latitude and longitude of each drivers in an orderly manner.
Please help.

If anyone have an app like this to share please do, I’ll really appreciate it.

For this type of app app needs to run in background for sync with database

The app doesn’t need to run in background, the app will only work if it is opened, which means I’ll keep screen on and the app won’t be able to close when back press.

Sorry did not understand

Hello, you can use databases to store latitude and longitude, whenever a new location is obtained, save it in the database. When you need to display the location history, collect the values ​​obtained from the database and show them on the map.

You can store the locations in a list in the database, which will be stored in a tag, with each pair of coordinates (latitude and longitude) a unique item in the list, with a corresponding index.

In the example I’m using TinyDB, but it is an internal database on the user’s device, I suggest you use databases in the cloud.

The tag is the name that you will assign to the stored locations, you must name it according to the need, as they are vehicle locations, you can use the vehicle plate as a name for the list of its coordinates, so each vehicle will have your own list of coordinates stored in a tag according to your plate.
If you want to store according to the order, you will have more work, I suggest you create a unique “tag” for each order, and store the coordinates using the order tag.

Example:

call TinyDB store value
tag: “vehicle_locations_1” (this is the list tag)
value: latitude 1 / longitude 1 (this is the first item, receives index 1)
latitude 2 / longitude 2 (index 2, the first item receives the latitude, the second the longitude, example: 55,123456 / 78,298391)
latitude 3 / longitude 3 (index 3)
latitude 4 / longitude 4 (index 4)
latitude 5 / longitude 5 (index 5)

The “/” will be used to separate the coordinate pair.
So, to call these values, you need to create a variable that will receive the TinyDB values ​​in LIST format:

initialize global CoordinateList: create empty list

set global CoordinateList to: call TinyDB get value
tag: “vehicle_locations_1”

When you want to get each of these values, you will need to store them in a new variable, suggestion:

initialize global CoordinatesPair: create empty list

set CoordinatesPair to: select list item list: get global
index: [1] (this is the index of the coordinate pair you are getting)

This will return a string with the coordinate pair, use the “Spli text” block to separate the coordinates in latitude and longitude.

initialize global Latitude: 0
initialize global Longitude: 0

set global Latitude to: select list item list: Split text: get global CoordinatesPair
at: “/”
index: 1
set global Longitude to: select list item list: Split text: get global CoordinatesPair
at: “/”
index: 2

Done, you have your coordinates separated again, now mark the ones on the map, it’s not difficult, research and study about the Map component of Kodular, I’m sure you will love it.
After being able to mark these coordinates on the map everything will be easy, just repeat the same process for all the coordinates you have stored. Study on the “for each” block.

If you want help with this project, I am willing to contribute, good luck and a big hug from Brazil!

5 Likes

Thank you very much, you really understood what I was really asking for. I’ll try the method stated above and if I have any issue I’ll let you know.

1 Like

Thank for your concern @Delta_Fe understood what I am asking for, you can also be of help.

1 Like

Firebase free has limitations. I use Mysql.Good Luck.Good Search. Good studies.

2 Likes

Can airtable also be used?

1 Like

You’re welcome!

About Airtable:
Yes, it can, depends on what you need to do, some solutions can be better than others depending on your neededs.

On Kodular you will find that as the component “Spreadsheet”.

Oh, thank you.

1 Like