I have just finished writing a basic chat app and is working fine, thanks to Smack library (and developers for sure). Now I have requirement where user can opt in settings to keep the app running even after closing the main app.
I have checked a lot of threads where
Sticky service is suggested. But since Android 8 (API 26) the OS terminates such services when app goes into background, which means this suggestion does not work. And according to this old but I believe still relevant, we should avoid foreground service. Moreover, putting sticky notification required by Google for foreground is annoying.
So what is post-Oreo solution for Smack Background service?