Send Location Updates to Server in Background

Solution 1:

I already used a similar method in my app which is working:

I used foreground service to record the location, the battery consumptions are related to the frequency of location request not really the foreground service itself. indeed using LocationListener is a good option

then I am checking the foreground service regularly using workmanager and restart it when needed.

best