java.lang.Object | |
↳ | com.google.android.gms.gcm.Task |
![]() |
Encapsulates the parameters of a task that you will schedule on the
GcmNetworkManager
.
Construct instances of either PeriodicTask
or
OneoffTask
with the desired parameters/behaviour and
schedule them using schedule(Task)
.
Nested Classes | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
Task.Builder | Builder object to construct these tasks before sending them to the network manager. |
Constants | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
int | EXTRAS_LIMIT_BYTES | The maximum size allowed for extras bundle in bytes. | |||||||||
int | NETWORK_STATE_ANY |
Specify using setRequiredNetwork(int)
that your task will execute irregardless of whether network is available.
|
|||||||||
int | NETWORK_STATE_CONNECTED |
Specify using setRequiredNetwork(int)
that your task will only execute if some sort of data connection is available -
either metered or unmetered.
|
|||||||||
int | NETWORK_STATE_UNMETERED |
Specify using setRequiredNetwork(int)
that your task will only execute if there is an unmetered network connection available.
|
|||||||||
long | UNINITIALIZED |
[Expand]
Inherited Constants | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
![]() |
Public Methods | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
If the specified network is unavailable, your task will not be run until
it is.
| |||||||||||
If the device is not charging and this is set to true, your task will not be run
until it is.
| |||||||||||
[Expand]
Inherited Methods | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
![]() | |||||||||||
![]() |
The maximum size allowed for extras bundle in bytes.
Specify using setRequiredNetwork(int)
that your task will execute irregardless of whether network is available.
Specify using setRequiredNetwork(int)
that your task will only execute if some sort of data connection is available -
either metered or unmetered. This is the default.
Specify using setRequiredNetwork(int)
that your task will only execute if there is an unmetered network connection available.
If the specified network is unavailable, your task will not be run until it is.
If the device is not charging and this is set to true, your task will not be run until it is.
GcmTaskService
component that this task
will execute on.
onRunTask(com.google.android.gms.gcm.TaskParams)
when this task executes.