When app goes in background (by pressing home button). When screen goes off, after 15-20 mins the background service stops on Android M (6.0) phone. Although it works fine on phone with Lollipop (5.0).
Android M introduced Doze and App Standby which limits background services in order to preserve battery. How to handle Doze can be found in this official android training manual.
edit: Although not part of the original question, if you want to support Android O you will also have to keep the new Background Execution Limits in mind. How to do this can be found in this official android training manual.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With