Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Background service stops on Android Marshmallow 6.0+ devices

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).

like image 861
Akhtar Khan Avatar asked Nov 30 '25 16:11

Akhtar Khan


1 Answers

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.

like image 199
Sander Avatar answered Dec 02 '25 06:12

Sander