Open faelys opened 4 years ago
Well we support only simple HTTP/HTTPS url call to send coordinates to the web server. We have no plans to insert coordinates in the format cause it could be very complicated to it in a general way, it is much easier to do on a server / proxy side to take lat/lon as a parameter and submit as JSON / GPX or whatever is better format for your task
I don't really understand what you mean with "to insert coordinates in the format". They already are in {0}
and {1}
, you would only need to use same MessageFormat.format
as already exists for the URL to build the payload, and send it using the POST
method instead of GET
.
Or is there something I'm missing that makes POST
requests much more complicated to send than GET
?
I'm also looking for a way to send OsmAnd Online Tracking data as a POST request.
It's very unusual for an API to save new data from a GET request. Any browser can open the GET url and attempt to insert data.
Would you accept a PR to add support for POST requests? I believe there should be an option "HTTP method" that proposes to select "GET" or "POST".
Hello,
I'm a bit surprised to not see this feature already requested, so please forgive me if it's a duplicate or if I'm doing something wrong.
Basically I have a owntracks recorder server, whose interface I like, and would like to share my GPS position in about the same set of circumstances in which I record my GPX track with OsmAnd. I have some troubles (with accuracy and/or battery use) with the owntracks Android app, so I would be interested in having OsmAnd send its position directly to the owntracks recorder.
While the use case might interest very few people, I feel like this feature is probably easy to implement (though I might be wrong, having no idea what Android development is like).
Basically it would be exactly like the existing GPX online tracking, except instead of sending the data through parameters in a GET request, send it to a user-given URL using a POST request with HTTP Basic Authentication and a JSON payload.
The JSON could be hardcoded or filled from a user-given template (which would be like
{"_type":"location","tid":"01","lat":{0},"lon":{1},"tst" :{2},"acc":{3},"alt":{4},"vel":{5}"}
using the same format as the URL of the existing GPX online tracking (and only thetid
field value has to somehow come from the user).However, having a user-provided template for the POST payload would probably make it more flexible and futreproof, by allowing a wider variety of servers instead of focusing on owntracks recorder.
It feels like the actual code to that would be quite easy to insert in
LiveMonitoringHelper.java
, but maybe the UI part is too much work.