I am making a simple Android app that monitors a server status and sends an SMS when something is wrong. It is working fine when the phone is awake, but as soon as the phone goes to sleep, the app sort of freezes immediately. How to make the app continue to do its job when in sleep?
Android version is 5.1.1