android - GcmNetworkManager OneoffTask ExecutionWindow needed? -
i starting implement gcmnetworkmanager
trigger sync when user gets internet connection back
when looking @ docs oneofftask says setexecutionwindow mandatory
mandatory setter creating one-off task
however want execute when user has internet , sounds execute before user has internet in window of windowstartdelayseconds
, windowenddelayseconds
.
so mean network manager execute task sometime before windowenddelayseconds
or mean once internet has been restored execute in time?
it means cgm try execute @ point between windowstartdelayseconds
, windowenddelayseconds
after has been registered, taking in consideration specified network state.
for example, if use .setexecutionwindow(30, 40)
, use .setrequirednetwork(task.network_state_connected)
, means task executed @ point between 30 , 40 seconds after being registered only if connected network.
so yes, executed before windowenddelayseconds
, depends on network state.
Comments
Post a Comment