Simple-Alarms icon indicating copy to clipboard operation
Simple-Alarms copied to clipboard

Alarm not triggered after closing app from resent screens

Open fabritronixdesignlabs opened this issue 5 years ago • 7 comments

Hi @PPartisan ,

I have done simple app to remind notifications for user. I gone through your source code. Same thing i have implemented in my app. The alarm was triggered when app is alive.When install your source apk into device, it was working fine even if we kill the app. I have tested on one plus 5t device. Thanks and Regards, Amar.

fabritronixdesignlabs avatar Feb 10 '21 07:02 fabritronixdesignlabs

Hi,

I don't understand your comment. Is the problem with the Simple-Alarms app, or with the app you have made based on the Simple-Alarms source code? Your comment that the alarm works correctly when the app is alive, and when the app is killed, has confused me. Could you please clarify?

PPartisan avatar Feb 10 '21 23:02 PPartisan

Thanks for replying @PPartisan , Simple alarm app working fine either app kill or alive. I have done alarm based application based simple alarm app source code. My app is working fine when it's be in alive state. When we kill app from recent. The alarm not triggered.

fabritronixdesignlabs avatar Feb 12 '21 13:02 fabritronixdesignlabs

If it's a problem with your app, then I'm not sure what I can do about it. If Simple-Alarms works, then the answer evidently lies in the source code somewhere. There was a similar bug I resolved years ago, see #8 and #9

PPartisan avatar Feb 12 '21 15:02 PPartisan

@PPartisan ,Thanks for your suggestions. I tried above suggestions, it was not working. After lot of gone through documents. I have found solution, i.e we have to set disable battery optimization in the app info advance section. I was just wondering how the simple alarm app working ,even if we have not set any battery optimizations. Device Model : One Plus 5T.

fabritronixdesignlabs avatar Feb 15 '21 11:02 fabritronixdesignlabs

I could only guess.

If you use the AlarmManager#setAlarmClock API to set your Alarm, as Simple Alarms does, then my next guess would around the target API version. Simple-Alarms targets API 28, but a higher API target than this may introduce more restrictions. I'm doubtful however, as this device you quoted is on an older version of Android.

PPartisan avatar Feb 15 '21 11:02 PPartisan

@PPartisan, Yes exactly the device will take AlarmManager#setAlarmClock to set alarm. I have changed target API version 30 in simple alarm app and have tested in One Plus Device, it was working fine . I think this is the latest API version.

fabritronixdesignlabs avatar Feb 15 '21 12:02 fabritronixdesignlabs

I'm afraid I can't offer any more insights, in that case. Let me know if you resolve this issue as I'm curious to know what exists in Simple Alarms that prevents this step of disabling battery optimisations. I am going to close this thread now as there's no more information I can provide.

PPartisan avatar Feb 18 '21 12:02 PPartisan