How is an Intent Service Declared in the Android Manifest?

gtdevel picture gtdevel · Aug 22, 2011 · Viewed 78.6k times · Source

Straight forward question:

Is an IntentService declared in the Android Manifest as a regular service, or is there another way? It tried searching for it, but I couldn't find the answer.

Here is the regular Service declaration:

 <service
                android:name=".NameOfService">
 </service>

Thanks

Answer

Randroid picture Randroid · Aug 22, 2011

In your manifest you declare a service with android:name=".Communication", this means that your service class should be located in com.exercise.AndroidClient.Communication

Check that the packages are correct. Note that the "." (dot) refers to the root of your package (ie the package declared in the manifest). So, for example, if your package is com.exercise.AndroidClient and your service class is under com.exercise.AndroidClient.services.Communication you need to declare the service like this:

<service android:enabled="true" android:name=".services.Communication" />

Or specify the full package:

<service android:enabled="true" android:name="com.exercise.AndroidClient.services.Communication" />