JobScheduler will run jobs at Android’s discretion and, on top of that, once the phone enters in Doze Mode, the frequency of these jobs being run will constantly decrease. Essentially, they are killed once the app is in background for a while making them worthless for our purpose of running an always-running service.Īccording to Android recommendations, we should be using JobScheduler, which seems to work pretty well and will handle wakelocks for us, keeping the phone awake while the jobs are running. Hope it helps! The problemĭue to Android battery optimizations introduced in Android 8.0 (API level 26), background services have now some important limitations. This is just a guide for all of you who pursue the same goal. I’ve been struggling these days trying to find a way to run an endless service in Android.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |