Richard O'Sullivan Member Licensed User Jun 4, 2017 #1 Hi All, I'm trying a very simple program to record my GPS location every minute and/or 5 meters. The Location_Changed function is providing the data but where I included an SQL function to insert data into the database I'm getting 2 records for the same location. It appears as if the function is holding a value and when a new location comes along it fires the SQL because the old location has changed and then finds that the new value now exists and fires it a second time. I've had to resolve using an alternating boolean value. Any ideas what exactly is happening and proper resolution? Second issue i have is that I'm storing the data in a table using dbutils ExecuteHTML. The Lat and Lon fields only display to 4/5 decimal places - I want to display 8 decimal places. Can someone please explain the use of HTMLCSS noted with this function and better still provide a simple working example. Others have requested this option explained and "Search the forums " is not a helpful answer. Richard
Hi All, I'm trying a very simple program to record my GPS location every minute and/or 5 meters. The Location_Changed function is providing the data but where I included an SQL function to insert data into the database I'm getting 2 records for the same location. It appears as if the function is holding a value and when a new location comes along it fires the SQL because the old location has changed and then finds that the new value now exists and fires it a second time. I've had to resolve using an alternating boolean value. Any ideas what exactly is happening and proper resolution? Second issue i have is that I'm storing the data in a table using dbutils ExecuteHTML. The Lat and Lon fields only display to 4/5 decimal places - I want to display 8 decimal places. Can someone please explain the use of HTMLCSS noted with this function and better still provide a simple working example. Others have requested this option explained and "Search the forums " is not a helpful answer. Richard
Erel B4X founder Staff member Licensed User Longtime User Jun 5, 2017 #2 Lets start with the duplicate records. Can you post the relevant code? Upvote 0
Richard O'Sullivan Member Licensed User Jun 5, 2017 #3 Erel, Attached is the project and database. I've created GPSWriteData using a tag to skip every 2nd Write. It's commented out in the project. It works but it's ugly. I've just noticed the HTMLCSS string in the DBUtils module. Richard Attachments Geo.zip Geo.zip 11.8 KB · Views: 464 signcap.zip signcap.zip 473 bytes · Views: 443 Upvote 0
Erel, Attached is the project and database. I've created GPSWriteData using a tag to skip every 2nd Write. It's commented out in the project. It works but it's ugly. I've just noticed the HTMLCSS string in the DBUtils module. Richard
Erel B4X founder Staff member Licensed User Longtime User Jun 5, 2017 #4 Your code calls GPS.Start multiple times. This will cause multiple events to be raised each time. See the latest version of the GPS example: GPS tutorial It is much better to handle the GPS in the starter service. Upvote 0
Your code calls GPS.Start multiple times. This will cause multiple events to be raised each time. See the latest version of the GPS example: GPS tutorial It is much better to handle the GPS in the starter service.
Richard O'Sullivan Member Licensed User Jun 5, 2017 #5 Thanks Erel, I will check that out. On the HTMLCSS topic I've realised that it's difficult to format numbers in CSS - its the table you format so I've switched to saving the Lat,Lon as Text and it displays as expected. Richard Upvote 0
Thanks Erel, I will check that out. On the HTMLCSS topic I've realised that it's difficult to format numbers in CSS - its the table you format so I've switched to saving the Lat,Lon as Text and it displays as expected. Richard