0

I have an app wchich should do some work once per day. I'm using AlarmManager and setExact(...) method (set(...) on pre KitKat devices) and custom BroadcastReceiver. This code works on all tested phones (android versions between 4.2 and 6.0.1), but there is one device with very strange behavior. On Huawei P8 Light (Android 6.0.1) application works fine, but when i kill my app using task manager AlarmManager stops and my everyday task is never triggered. I tried to build some workaroud using Sticky service, but it's also killed when i kill app using task manager.

My code works properly on Huawei only when app is not killed. Is this normal behavior for this spartphone? I never met anything like this. Is there any way to force this phone to proper work?

omnipotg
  • 43
  • 1
  • 6
  • Please note that your alarm will be canceled as well when you kill your app. Please check this thread for more details: http://stackoverflow.com/questions/19828197/will-alarmmanager-work-if-my-application-is-not-running. I suggest to use JobScheduler. Please see this project http://stackoverflow.com/questions/19828197/will-alarmmanager-work-if-my-application-is-not-running if you have to support older android versions as well. – Blehi Sep 01 '16 at 20:06
  • @Blehi But core element of JobSheduler is JobService which extends standard Service class. Does JobScheduler work properly if my Sticky Service was killed with app? On other phones Sticky service works fine, so i think JobScheduler is a good idea, but i'm not sure what about this specific device. – omnipotg Sep 02 '16 at 05:37
  • We have also a lot of problems with the Huawei devices. They use some custom ROMs and there are a few things that don't work as on the other devices. – Blehi Sep 02 '16 at 09:55
  • But i wonder how "standard apps" like Google Calendar still works fine, while we have problems with basic mechanisms like Services. – omnipotg Sep 02 '16 at 10:23
  • 1
    Google apps works fine because they are embedded as system apps. I also have the same problem in specific devices. – Aman Kaushik Oct 08 '16 at 10:02

0 Answers0