Android Question service does not work

Jhohann Fabian Salazar L

Licensed User
good morning co-workers, I have a service that every 10 seconds queries for http, happens that in a lapse of time, the service stops working, and if I open the app it comes back and it works, how do I make the service run forever? ?, like a whatsapp. Thank you