I have an endless foreground service that request locations updates every 10 sec, in parallel, it sends this locations and others informations to a database. I managed to update the location while the app is in the background or when the phone is on standby. The app works fine for some days but for some reason that I cannot understand, the locations somehow stops while the phone is still running and the service still sends the other informations.
Is there a reason why the phone would stop request locations but still run the foreground service ?
The service is set as a Sticky service so it should restart if the memory runs out of space and the request update locations is triggered when the service is started.
The "Allow all the time" location setting is on for my app and like I said works fine for 2 to 3 days.
I was thinking about a problem concerning the battery charge not being sufficient to run location request, but didn't found anything on the subject so far.
I also tried a Wakelock to keep the app updating locations but didn't work.