| java.lang.Object | |
| ↳ | com.google.android.gms.gcm.Task |
Known Direct Subclasses
|
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 regardless of whether a 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 | |||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|
From interface
android.os.Parcelable
| |||||||||||
| 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 | |||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|
From class
java.lang.Object
| |||||||||||
From interface
android.os.Parcelable
| |||||||||||
The maximum size allowed for extras bundle in bytes.
Specify using setRequiredNetwork(int)
that your task will execute regardless of whether a 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.