page.title=<service> parent.title=The AndroidManifest.xml File parent.link=manifest-intro.html @jd:body
<service android:enabled=["true" | "false"] android:exported=["true" | "false"] android:icon="drawable resource" android:isolatedProcess=["true" | "false"] android:label="string resource" android:name="string" android:permission="string" android:process="string" > . . . </service>
<application>
<intent-filter>
<meta-data>
All services must be represented by {@code
The <application>
element has its own
enabled
attribute that applies to all
application components, including services. The
<application>
and {@code
The default value depends on whether the service contains intent filters. The absence of any filters means that it can be invoked only by specifying its exact class name. This implies that the service is intended only for application-internal use (since others would not know the class name). So in this case, the default value is "{@code false}". On the other hand, the presence of at least one filter implies that the service is intended for external use, so the default value is "{@code true}".
This attribute is not the only way to limit the exposure of a service to other
applications. You can also use a permission to limit the external entities that
can interact with the service (see the permission
attribute).
<application>
element's icon
attribute).
The service's icon — whether set here or by the
<application>
element — is also the
default icon for all the service's intent filters (see the
<intent-filter>
element's
icon
attribute).
<application>
element's
label
attribute).
The service's label — whether set here or by the
<application>
element — is also the
default label for all the service's intent filters (see the
<intent-filter>
element's
label
attribute).
The label should be set as a reference to a string resource, so that it can be localized like other strings in the user interface. However, as a convenience while you're developing the application, it can also be set as a raw string.
<manifest>
element.
Once you publish your application, you should not
change this name (unless you've set android:exported="false"
).
There is no default. The name must be specified.
{@link android.content.Context#startService startService()}
,
{@link android.content.Context#bindService bindService()}
, or
{@link android.content.Context#stopService stopService()}
,
has not been granted this permission, the method will not work and the
Intent object will not be delivered to the service.
If this attribute is not set, the permission set by the
<application>
element's
permission
attribute applies to the service. If neither attribute is set, the service is
not protected by a permission.
For more information on permissions, see the Permissions section in the introduction and a separate document, Security and Permissions.
<application>
element's
process
attribute can set a different
default for all components. But component can override the default
with its own {@code process} attribute, allowing you to spread your
application across multiple processes.
If the name assigned to this attribute begins with a colon (':'), a new process, private to the application, is created when it's needed and the service runs in that process. If the process name begins with a lowercase character, the service will run in a global process of that name, provided that it has permission to do so. This allows components in different applications to share a process, reducing resource usage.
<application>
<activity>