I would like to put the GCMIntentService in a directory other than my package root.
The GCM documentation states that
By default, it must be named .GCMIntentService, unless the
application uses a custom BroadcastReceiver that redefines its name.
My question is - how do I create this "custom BroadcastReceiver" thay talk about?
Try this -- Rename or change package of GCMIntentService class
The basic docs have you add the following to your manifest:
<receiver android:name="com.google.android.gcm.GCMBroadcastReceiver" android:permission="com.google.android.c2dm.permission.SEND" >
<intent-filter>
<action android:name="com.google.android.c2dm.intent.RECEIVE" />
<action android:name="com.google.android.c2dm.intent.REGISTRATION" />
<category android:name="my_app_package" />
</intent-filter>
</receiver>
This points to a GCM-supplied BroadcastReceiver
that will route events to your .GCMIntentService
. If you wish to have your service reside in some other package, you will need to supply your own BroadcastReceiver
. This may be as simple as creating one that subclasses GCMBroadcastReceiver
and overrides getGCMIntentServiceClassName()
to return the fully-qualified class name of the service to use.