Location Plugin: Able to save coordinates, but most of them are the same

Hi everyone,

I'm trying to build a mobile app that will save the latest location of the user for every OnPositionChanged (every 5 seconds).

As of now, the position of the marker that represents the current location did change everytime there was a change in location, but most of the coordinates that get saved in the database are the same (as if there was never a change in location).

I'm using WatchLocationExample from this link https://www.outsystems.com/forums/discussion/20602/on-position-changed-location-tracker/ and added an OnRender client action that will save the coordinates to the database.

Hi,

Attached an example using this plugin that I did some time ago. The difference is I send a  feedback message with the location. and everything is working. The change you need to do is on HomeScreen > LocationTrackerOnPositionChanged and had the save to the database.

Hope this helps.

Regards,

Marcelo


Marcelo Ferreira wrote:

Hi,

Attached an example using this plugin that I did some time ago. The difference is I send a  feedback message with the location. and everything is working. The change you need to do is on HomeScreen > LocationTrackerOnPositionChanged and had the save to the database.

Hope this helps.

Regards,

Marcelo


Hi,

It was the same example that I have been experimenting on. First, I added the Save to database right after the feedback message, but it doesn't work.

Then, I created an On Render action and added the Save to database there. It does work, but most of the coordinates that are being saved are the same. My objective is to save different coordinates as there is a change in location (e.g. from Location A -> Location B, it should save both coordinates. But instead, it only save Location A)


Hi,

The OnRender is not the correct place. Now my example does more less what you want.

Take a look.

Regards,

Marcelo

Marcelo Ferreira wrote:

Hi,

The OnRender is not the correct place. Now my example does more less what you want.

Take a look.

Regards,

Marcelo


Hi,

Thanks for the example. Yeap, it does more or less what I'm trying to achieve. I've tried it just now and yes, it managed to save different coordinates.

By the way, do you know on how to:

1) Use background location tracker to track location in background mode (without having to open this app)?

2) Convert the coordinates into waypoint / route (from coordinate A -> coordinate B, it will draw a route)

Hi,

Mobile is not my specialty but to draw a route i think you can use this component and for background location read this post.

Regards,

Marcelo