I have an app that needs to run always in the background and listen for server changes. When I target API below Oreo, I am able to run service in the background. But now I'm targeting the API version 28. But Oreo changes not allowing to run in background service.

Solution: I need to make it the foreground service ( but I don't want to make a foreground service ).

I want to at least run my service for 30 minutes in the background. I have used JobService and JobIntentService. But oreo kills these service after sometime. 

What can be the possible solution for that?