I need a service which should run 24/7 which does the following functions.
(1) checking GPS of the user with fusedLocationApi every second to check if the user enters a particular geofence.
(2) checking if another application package is installed (Thread)
(3) send an alive packet to the server by a particular interval of 60 seconds. (Thread)
The threads are singleton instances since I have to assure that only one thread per function run, for battery life.
All the above threads run on the foreground service's onStartCommand. I've read that the foreground service itself will not die on most circumstances, but how are the threads? Are threads started from the foreground service persistent as well? And furthermore, how can I test to prove that it's persistent?