public class GCMRegisterDeviceAsyncTask
extends Fragment
Modifier and Type | Class and Description |
---|---|
private class |
GCMRegisterDeviceAsyncTask.GCMRegisterDevice |
static interface |
GCMRegisterDeviceAsyncTask.OnGCMDeviceRegistrationListener
Sends callback to the activity for the stages
of the Asynchronous task in progress.
|
Modifier and Type | Field and Description |
---|---|
private ApplicationPreferences |
applicationPreferences |
private Activity |
mActivity |
private Context |
mContext |
private com.google.android.gms.gcm.GoogleCloudMessaging |
mGoogleCloudMessaging |
private static GCMRegisterDeviceAsyncTask.OnGCMDeviceRegistrationListener |
mListener |
private java.lang.String |
mMessage |
private java.lang.String |
regId |
private GCMRegisterDeviceAsyncTask.GCMRegisterDevice |
registerDeviceTask |
private static java.lang.String |
TAG |
Constructor and Description |
---|
GCMRegisterDeviceAsyncTask() |
Modifier and Type | Method and Description |
---|---|
void |
onAttach(Activity activity) |
void |
onCreate(Bundle savedInstanceState) |
void |
onDetach() |
void |
onPause() |
void |
onResume() |
void |
onStart() |
void |
onStop() |
private void |
sendRegistrationIdToBackend()
Can be implemented here or from the activity
Sends the registration ID to your server over HTTP, so it can use GCM/HTTP
or CCS to send messages to your app.
|
private void |
storeRegistrationId(Context context,
java.lang.String regId)
Method for storing the registration id locally
after the registration process is completed.
|
private static final java.lang.String TAG
private com.google.android.gms.gcm.GoogleCloudMessaging mGoogleCloudMessaging
private java.lang.String regId
private java.lang.String mMessage
private Activity mActivity
private static GCMRegisterDeviceAsyncTask.OnGCMDeviceRegistrationListener mListener
private GCMRegisterDeviceAsyncTask.GCMRegisterDevice registerDeviceTask
private Context mContext
private ApplicationPreferences applicationPreferences
public void onStart()
public void onPause()
public void onStop()
public void onResume()
public void onCreate(Bundle savedInstanceState)
public void onAttach(Activity activity)
private void storeRegistrationId(Context context, java.lang.String regId)
context
- - application contextregId
- - device registration idprivate void sendRegistrationIdToBackend()
public void onDetach()