<service android:enabled=["true" | "false"] android:exported[="true" | "false"] android:icon="drawable resource" android:label="string resource" android:name="string" android:permission="string" android:process="string" > . . . </service>
<application><intent-filer>
<meta-data>Service subclass) as one
of the application's components. Unlike activities, services lack a
visual user interface. They're used to implement long-running background
operations or a rich communications API that can be called by other
applications.
All services must be represented by <service> elements in
the manifest file. Any that are not declared there will not be seen
by the system and will never be run.
android:enabledtrue" if it can be, and "false" if not. The default value
is "true".
The <application> element has its own
enabled attribute that applies to all
application components, including services. The
<application> and <service>
attributes must both be "true" (as they both
are by default) for the service to be enabled. If either is
"false", the service is disabled; it cannot be instantiated.
<application> 엘리먼트는, 서비스를 포함하는 모든 애플리케이션 컴포넌트에 적용되는 그것 소유의 enabled 애트리뷰트를 가진다. 서비스가 활성화 되게하기 위해서는 <application> 과 <service> 애트리뷰트 모두 (디폴트로 그것들 모두가 그렇듯이) ”참true”이어야 한다. 만일 어느 것 하나라도 “거짓false”이라면, 서비스는 비활성화 된다; 그것은 인스턴스화 될 수 없다.
android:exportedtrue" if they can, and
"false" if not. When the value is "false", only
components of the same application or applications
with the same user ID can start the service or bind to it.
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 "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 "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).
디폴트 값은 서비스가 인텐트 필터를 포함하는 지 여부에 따라 다르다. 아무런 필터도 없다는 것은 그것의 정확한 클래스 이름을 지정하는 것에 의해서만 호출될 수 있다는 것을 의미한다. 이것은 서비스가 애플리케이션 내부 용도를 위해서만 의도되었다는 것을 의미한다(다른 것들이 클래스 이름을 모를 것이기 때문에). 그러므로 이런 경우에 디폴트 값은 “거짓false”이다. 반면에, 최소한 하나의 필터라도 있다는 것은 서비스가 외부 사용을 위해 의도되었다는 것을 의미한다. 그러므로 디폴트 값은 “참true”이다.
이 애트리뷰트가 다른 애플리케이션에게 서비스의 노출을 제한하는 유일한 방법은 아니다. 여러분은 또한 서비스와 상호작용할 수 있는 외부 엔티티를 제한하기 위해서 퍼미션을 사용할 수 있다(permission 애트리뷰트를 보라).
android:icon<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> 엘리먼트에서 설정되던 상관없이 ? 또한 모든 서비스의 인텐트 필터에 대한 디폴트 아이콘이다(<intent-filter> 엘리먼트의 icon 애트리뷰트를 보라).
android:label<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.
서비스의 라벨은 ? 여기서 설정되던 또는 <application> 엘리먼트에서 설정되던 상관없이? 또한 모든 서비스의 인텐트 필터에 대한 디폴트 라벨이다 (<intent-filter> 엘리먼트의 label 애트리뷰트를 보라).
라벨은 사용자 인터페이스의 다른 문자열처럼 로컬라이즈될 수 있도록 문자열 리소스에 대한 레퍼런스로써 설정되어야 한다. 하지만 편의상 여러분이 애플리케이션을 개발하고 있는 동안 그것은 또한 원시 문자열로 설정될 수 있다.
android:nameService subclass that implements
the service. This should be a fully qualified class name (such as,
"com.example.project.RoomService"). However, as a shorthand, if
the first character of the name is a period (for example, ".RoomService"),
it is appended to the package name specified in the
<manifest> element.
There is no default. The name must be specified.
디폴트는 없다. 이름은 지정되어야만 한다.
android:permissionstartService(),
bindService(), or
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> 엘리먼트의 permission 애트리뷰트에 의해 설정된 퍼미션이 서비스에 적용된다. 만약 이 두개의 애트리뷰트가 설정되지 않는다면, 서비스는 퍼미션에 의해 보호되지 않는다.
퍼미션에 관한 더 많은 정보에 대해서, 앞에 나왔던 퍼미션 섹션과 8장. “보안과 퍼미션”을 보라.
android:process<application> element's
process
attribute can set a different
default for all components. But component can override the default
with its own 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.
만약 이 애트리뷰트에 할당된 이름이 콜론(“:”)으로 시작한다면, 애플리케이션에 사적private인 신규 프로세스가 필요할 때 생성되며, 서비스는 그 프로세스에서 실행된다. 만약 프로세스 이름이 소문자로 시작한다면, 서비스는 그 이름을 가지는 글로벌 프로세스에서 실행되며 이는 그렇게 하도록 하는 퍼미션을 가진 경우 가능하다. 이것은 다른 애플리케이션에 있는 컴포넌트가 하나의 프로세스를 공유하는 것을 가능하게 하며, 리소스 사용을 줄인다.
<application>
<activity>