I have a task where it reads data from server every 10 seconds. I gave a try to gcm network manager where I created a periodic task and set the interval to 10L. But the task is not firing in every 10 seconds. The minimum time for successive firing is 30 seconds even though I mentioned it to be 10 seconds. Any help on this would be greatly appreciated. Also, please let me know if there is any other best method to achieve it. Here's the code that I've used :
mGcmNetworkManager = GcmNetworkManager.getInstance(this);
PeriodicTask task = new PeriodicTask.Builder()
.setService(MyService.class)
.setTag(TASK_TAG_PERIODIC)
.setPeriod(10L).
setRequiredNetwork(Task.NETWORK_STATE_UNMETERED)
.build();
mGcmNetworkManager.schedule(task);
And just for test purpose, I use a log statement in my MyService.class. The service gets fired only after every 30seconds(approx.). I would like to know what is the minimum time interval I can set for the gcm network manager to fire the periodic tasks.
Thanks to all in advance.