Capture the current location of the user in a time interval and send it to the server

3

Talk the guys.

So, I need my app to send the user's location to my remote server every x minutes. I would like to know what the best workflow would be for this to happen in the right way. I think the way is using Services and AlarmManager but I have never implemented anything like this and am in doubt about the correct workflow to follow. Another important point is the need to locate the user to be sent to the remote server even if the app is not running.

    
asked by anonymous 16.06.2017 / 20:52

1 answer

0

You will use a AlarmManager that starts a Service every X sec, as long as you want.

The Service must include a class that implements a location listener .

And you simply get the location within a activity of Service and send it to the server using AsyncTask .

Take a look at this link that might help you: link

    
16.06.2017 / 21:10