Android GCMNetworkManager - Running a job between a specific timeframe everyday

100 Views Asked by At

I want to be able to run a periodic task within a certain timeframe every day, for example, between 8 AM and 11 AM. I'm not sure how I can do this with PeriodicTask, because you cannot specify a specific time of day.

I stumbled across this example, but it uses Evernote's Android-Job library. Is there a way to achieve this with GCMNetworkManager specifically?

1

There are 1 best solutions below

1
On BEST ANSWER

No, this is not possible with GCMNetworkManager.

However, this level of time gating can be achieved with the Awareness API as of the February 2017 - v.10.2 by registering a TimeFence (more specifically, the inDailyInterval() method).