to be more precise, than the title says:
I am working on a SIP App which uses a "sticky" Service when starting to boot the Sip stack and to keep it alive even when the app is in background for a long time and even when Android starts purging things when resources get low.
minApi Level is 15.
My technical Problem is this:
- Can I somehow "detect" when the user closes the app from the open-apps-list with a swipe? Or is this a simple and plain "kill" of my app's process and there is no available hook to perform some last action before getting killed?
What I need to achieve is:
- Service stays active all the time, no matter whether the app is in foreground or background and no matter for how long it stays there.
- The App must not be "exited" when pressing the back button on the main activity (dialer) - this is by requirement of the product owners - that part is solved.
BUT... - and here starts my problem:
- When the user is "killing" the app (i.e. swipe from the app list), the sip stack shall perform a shutdown and the user is "not available" via sip - i.e. "offline". Technical for my app, this means: Shutdown Sip / Stop the sticky service.
What approach to take here?
Thanks for any tipps, this is driving me crazy.