|
||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||
java.lang.ObjectIntentService
com.google.android.gcm.GCMBaseIntentService
public abstract class GCMBaseIntentService
Skeleton for application-specific IntentServices responsible for
handling communication from Google Cloud Messaging service.
The abstract methods in this class are called from its worker thread, and hence should run in a limited amount of time. If they execute long operations, they should spawn new threads, otherwise the worker thread will be blocked.
| Field Summary | |
|---|---|
static java.lang.String |
TAG
|
| Constructor Summary | |
|---|---|
protected |
GCMBaseIntentService(java.lang.String senderId)
Subclasses must create a public no-arg constructor and pass the sender id to be used for registration. |
| Method Summary | |
|---|---|
protected void |
onDeletedMessages(Context context,
int total)
Called when the GCM server tells pending messages have been deleted because the device was idle. |
protected abstract void |
onError(Context context,
java.lang.String errorId)
Called on registration or unregistration error. |
void |
onHandleIntent(Intent intent)
|
protected abstract void |
onMessage(Context context,
Intent intent)
Called when a cloud message has been received. |
protected boolean |
onRecoverableError(Context context,
java.lang.String errorId)
Called on a registration error that could be retried. |
protected abstract void |
onRegistered(Context context,
java.lang.String registrationId)
Called after a device has been registered. |
protected abstract void |
onUnregistered(Context context,
java.lang.String registrationId)
Called after a device has been unregistered. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
public static final java.lang.String TAG
| Constructor Detail |
|---|
protected GCMBaseIntentService(java.lang.String senderId)
| Method Detail |
|---|
protected abstract void onMessage(Context context,
Intent intent)
context - application's context.intent - intent containing the message payload as extras.
protected void onDeletedMessages(Context context,
int total)
context - application's context.total - total number of collapsed messages
protected boolean onRecoverableError(Context context,
java.lang.String errorId)
By default, it does nothing and returns true, but could be overridden to change that behavior and/or display the error.
context - application's context.errorId - error id returned by the GCM service.
protected abstract void onError(Context context,
java.lang.String errorId)
context - application's context.errorId - error id returned by the GCM service.
protected abstract void onRegistered(Context context,
java.lang.String registrationId)
context - application's context.registrationId - the registration id returned by the GCM service.
protected abstract void onUnregistered(Context context,
java.lang.String registrationId)
registrationId - the registration id that was previously registered.context - application's context.public final void onHandleIntent(Intent intent)
|
||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||