I\'m trying to give the user a notification each day on a certain time so I use an AlarmManager with a notification. I have this:
public void check_products(
It could be helpful to mention here. Optimize your app with Doze and app stand by article from android developers blog help you out.
If you need to set alarms that fire while in Doze, use setAndAllowWhileIdle() or setExactAndAllowWhileIdle().
you can find source here