I have started integrating GCM in my app. I have few queries regarding the package name in which GCMIntentService need to be put. As android.developer site states
By default, it must be named .GCMIntentService, unless the
application uses a custom BroadcastReceiver that redefines its name.
And my application was earlier using Service class, which was called BackgroundService which was in com.abc.xyz.service package. My root package name is com.abc.xyz.ui.activity. I have gone through this link and this one. Solution works with there package name but with my package name its not same. as my root package is different.
My query is Do I need to rename my package structure or there is some other way? I don’t want to rename the package name as its the standard format which we are using since beginning. So is there other way to do the same. Thanks in advance.
Edit
<receiver
android:name="com.abc.xyz.service.GCMReceiver"
android:permission="com.google.android.c2dm.permission.SEND" >
<intent-filter>
<!-- Receives the actual messages. -->
<action android:name="com.google.android.c2dm.intent.RECEIVE" />
<!-- Receives the registration id. -->
<action android:name="com.google.android.c2dm.intent.REGISTRATION" />
<category android:name="com.abc.xyz.ui.activity" />
</intent-filter>
</receiver>
<service android:name="com.abc.xyz.service.BackgroundService" />
Update and complete ansewer
As mentioned by Anup, it really does not matter where you put your file as far as you are qualifying it properly. Same did my job. You can take the ref. of my other question link which helped me achieving the answer. My this question link as every thing covered as it contains my manifest. So I am accepting Anup’s answer as its not wrong atleast.
As long as you qualify it properly in your manifest file declaration of the service, it really shouldn’t matter AFAIK. You can put it in any package you want, just make sure you qualify it properly wherever you use it.