2

I want to create a service that run every time in background I create one with different answer available on stack over flow but it is stopped by Power savor mode and battery savor mode in OPPO, Huawei devices. I tried alarm manager job scheduler and WakefulIntentService but all in vein. Can anyone please guide me that How can I write a service that run every time in background even if app is close and didn't depend on OS version and devices.

rana_sadam
  • 1,216
  • 10
  • 18
  • In general, service that you have already implemented should work on the *pure android*, but manufacturers like `OPPO, Huawei` usually modify firmware, so it is not a pure android anymore. So their firmware behaves the way they want, and not the way you want. This way you should never expect your service to be running all the time. And that's nothing you can do about it. – Vladyslav Matviienko Nov 15 '17 at 06:58
  • Their is another app having same feature like my app and it works fine. Actually I want to show local notification on my app 5 times a day other application work fine but my app stuck with this because color os kill all the procceses like Job Scheduler and Alarm Manager. – rana_sadam Nov 15 '17 at 07:06
  • if you need that only 5 times a day, then why do you want it to run all the time, and not to start only 5 times a day? – Vladyslav Matviienko Nov 15 '17 at 08:54
  • nothing is working neither 5 time a day nor constant running – rana_sadam Nov 15 '17 at 09:52
  • then you probably do it wrong way (with 5 times a day) – Vladyslav Matviienko Nov 15 '17 at 11:27
  • Color OS didn't allow alarm manager to trigger can you please – rana_sadam Nov 15 '17 at 11:58
  • that's right, but it is probably not because of ColorOS, but because Doze mode introduced in Android 6: https://stackoverflow.com/questions/32492770/how-to-make-alarm-manager-work-when-android-6-0-in-doze-mode – Vladyslav Matviienko Nov 15 '17 at 13:03
  • It is not working on OPPO device with lollipop – rana_sadam Nov 15 '17 at 13:17

0 Answers0