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

Asked

Viewed 104 times

3

Fala galera.

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

1 answer

0

You will wear a AlarmManager that initiates a Service every X sec, as long as you want.

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

And you just get the location inside a Activity of Service and send to the server using the AsyncTask.

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

Browser other questions tagged

You are not signed in. Login or sign up in order to post.