Android Question Storing whole route lines (GPS Tracking)

vfafou

Well-Known Member
Licensed User
Longtime User
Hello!
I'm looking for the best way to store GPS route line for every individual route dispatched from my system.
My database is MariaDB 10.1.
The options I'm thinking of, are:
  1. Keeping the coordinates into the tablet device and convert them to polyline, then send the polyline to the server and update the route record with the polyline.
  2. Keeping the coordinates into the tablet and send them as lat/lng pairs to the server.
Any other suggestion?
Note that I want to redraw the route on a Google Map.

Thank you in advance!
 

Erel

B4X founder
Staff member
Licensed User
Longtime User
Choose whichever one that is easier for you to handle, especially in cases where there is no internet connection.

Note that it can be a good case for CloudKVS. The client will write the data to the local database (using B4XSerializator to serialize your ruote objects) and CloudKVS will take care of updating it with the remote database.
 
Upvote 0

vfafou

Well-Known Member
Licensed User
Longtime User
Hello Erel!
Thank you for your reply!
It's a very convenient suggestion to use CloudKVS!
It didn't cross my mind as a solution...
By the way, I would like to ask you if the B4XSerializator is a good option of sending map collection or list objects from the server to the devices, instead of sending big delimited strings.
 
Upvote 0

RVP

Active Member
Licensed User
Longtime User
I do this by saving the gps location info into a MySQL database on the device, and then sending it to the central server running MS SQL using a web service I wrote. I only send the data every 5 minutes so as to not cause to much traffic, but I send all of the saved locations and clear the my SQL table when I so so. Data is sent as Json and includes the lat long as well as accuracy, direction and speed. If the device can't connect to the web service because it doesn't have network service, it just a tries again in 5 minutes. I also designed the tracking so it only saves A location every 1 minute, or if the device has moved at least 200 meters. This is good enough accuracy for my client, and saves on the amount of data.
 
Upvote 0

vfafou

Well-Known Member
Licensed User
Longtime User
Hello RVP!
Thank you for your reply!
I've found your suggestion being a very good option too!
My plan of amount of data is 6 locations every 1 minute.
How do you calculate the 200 meters movement?
Do you store the previous location and do the computation every time the locationchanged event is firing, or there is any more efficient way than this?
 
Upvote 0
Top