Hello everybody.

I want to take the data from the location of the device, at the time it is being used. To send it to the database.

Not like UBER does, which sends information to the server at each time separated by seconds. Only when they press a button.

I did not find information about it in the XOJO documentation. But, I think it has changed in the new version 2021.

Does anyone want to share an example?

I appreciate your comments.

Take a look at:


Thanks for your answer.

In the XOJO documentation, there is no example code.
It doesn’t explain much either.

Just mention: “WebLocation works only over HTTPS connections.”

I did a test with the two options it offers, Start and Request. Making sure the page is running over HTTPS.

it is very simple to use, get gps once or permanent.

just drop the WebLocation into a window and add the events via context menu.
i made a project sub folder Certificate with the “windows app name.crt” file
using a build step to copy this beside the executable file.
in build settings you set the ssl port.
you must be sure you made this ip:port accessible from outside / web.
you can use any dyndns provider.

xojo help

for your own use

at windows pc


as Admin

and register your service once
sc create XojoFotoDoku type= own start= auto binpath= "C:\Users\Markus\Documents\MR_Xojo\Foto Doku\Builds - Foto Doku\Windows 64 bit\Foto Doku\Foto Doku.exe"

at windows i set the service to a user account because i want save data there.

at windows pc you have to stop the service to overwrite it with a new executable / build.

as example once to get users location.

Sub Opening() Handles Opening
  System.DebugLog CurrentMethodName 
End Sub

at error you would see that you need https.

Sub Error(error As RuntimeException) Handles Error
  System.DebugLog CurrentMethodName + " " + error.Message
  TextLocation.Text = "Error "+ error.ErrorNumber.ToString + " : " + error.Message
End Sub

Sub LocationChanged(latitude As Double, longitude As Double, accuracy As Double, altitude As Double, altitudeAccuracy As Double, course As Double, speed As Double) Handles LocationChanged
  System.DebugLog CurrentMethodName 
  here you get the position data
End Sub

my .crt file looks like


it is mentioned in Web App Deployment Details

1 Like

Thank you very much, Markus !!!

It worked perfectly, using Windows, MacOS, and XOJO Cloud.

1 Like

I’m having the same problem trying to get WebLocation to work. Can’t put the certificate in the same folder during debug since the folder isn’t available until debugging has started. Even after providing the path to the file it doesn’t work. I am opening a local website using the localhost IP and Port 443. Is there a way to check that my project sees the certificate? Using Xojo 2021r3.

Anthony, this may help: