I have an app with a service with return Service.START_STICKY
in his onStartCommand. This service log the user locations to send it every hours in batch to the server. To economize the battery life I don't store the log to the disk, i simply keep it in memory. problem :
when the user kill the application, then it's look like the service is also killed but the ondestroy of the service is not fired. So how can i know when the service is being to be close/destroyed to save to disk all the log to retrieve it later ?
when the system restart the service thank to START_STICKY it's seam the onStartCommand is not called. is it a normal behavior ?