PROFESSIONAL NEWSGROUPS
WINDEV
,
WEBDEV
and
WINDEV Mobile
Home
|
Recent messages
|
Connect
|
Sign out
|
English
Home
→
WINDEV Mobile 2024
→
GPS PROBLEM ON BACKGROUND
GPS PROBLEM ON BACKGROUND
Started by PILAR, Apr., 14 2021 10:53 AM - 2 replies
Connect yourself…
PILAR
#1
Posted on April, 14 2021 - 10:53 AM
First of all sorry for my english.
I am working in an app that need to give the GPS of the user, even when the app is in background or close.
I have been trying several options but none of them are working.
The procedure is a call to the webservice, in which the info has to be passed a database and that it is updated, as I comment in quite simple, I have put in this procedure that the authomatic procedure is periodic execution when app is in background, and the procedure is as follows:
PROCEDURE posicionbackground()
dtData is DateTime
MyPosition is a geoPosition
MyPosition = GPSGetPosition()
IF gpsDisabled = True THEN
gsReport = "GPS Disabled"
dtData = SysDateTime()
ELSE IF gpsOffService = True THEN
gsReport = "GPS off service"
dtData = SysDateTime()
ELSE IF gpsUnavailable = True THEN
gsReport = "GPS Unavailable"
dtData = SysDateTime()
ELSE
gsReport = ""
dtData = ""
END
gsLatitude = MyPosition..Latitude
gsLongitude = MyPosition..Longitude
JSONResultado is JSON
vResultado is Variant
vPosicion is Variant
h est un httpRequête
h..Méthode = httpPost
h..URL = "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx"
h..ContentType = "application/json"
h..Entête["Authorization"] = "xxxxxxxxxxxxxxxxxxxxxxxxxx"
vPosicion.Empleado = gsIdCodiEmpleatLogged
vPosicion.Dispositivo = SysIdentifier()
vPosicion.Latitud = gsLatitude
vPosicion.Longitud = gsLongitude
vPosicion.Data = SysDateTime()
vPosicion.error = gsReport
vPosicion.DataError = dtData
h..Contenu = VariantVersJSON(vPosicion)
r est un restRéponse = RESTEnvoie(h)
JSONResultado = r..Contenu
vResultado = JSONToVariant(JSONResultado)
As I comment it is quite simple, I understand that I do not have to call the procedure anywhere else, because the call is supposed to be made automatically, I do not know if someone can give me a hand.
Thank you in advance.
Report
0
0
Ben
#2
Registered member
10 messages
Popularité : +1 (1 vote)
Posted on May, 19 2021 - 9:33 PM
https://developer.android.com/about/versions/10/privacy/changes
Report
0
0
PILAR
#3
Posted on June, 03 2021 - 6:06 PM
thank you very much.
Report
0
0
→ Go back to WINDEV Mobile 2024
WINDEV 2024
WEBDEV 2024
WINDEV Mobile 2024
WINDEV (earlier versions)
Français
English
Español
Portuguesa
Close this window
Search type
Only topics
All the messages
Search period
Any time
Past hour
Past 24 hours
Past week
Past month
Past year
Cancel
Preview of your message
Adding an image
Import an image from a URL
Send an image from a file of your disk
Drop a file or click "Browse..."
or
Cancel
0%
WLanguage
SQL
XML, HTML
JAVA, Javascript
Text