Testing GCM PeriodicTask

I use GCM Network Manager (PeriodicTask) to schedule regular background updates.

This system uses the GcmTaskService to run the background code. A Serviceextends this class, and work is done in public int onRunTask(TaskParams taskParams).

Serviceprobably gets his tasks through Intent, so I was hoping I could run it myself Service. However, for this I did not find any documentation.

Question: how can I test PeriodicTasks without setting a minimum period so that it works earlier (and also much more often).

Update # 1:

It seems that Intentmay be the way. Code execution ... PendingCallbackis required in order to GcmTaskServicebe able to start its thread.

+4
source share

Source: https://habr.com/ru/post/1621245/


All Articles