I want to run a network request once user closes an app i.e. onStop
and onDestroy
is called on app's activity. The problem is I also want to wait for response from server and save some data locally after I get it so the whole procedure may need to be finished after the app is fully closed.
Is there any kind of background service in Android which won't be terminated after app is closed and will be waiting for requests's completion (for some reasonable time at least)?