<receiver 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" > . . . </receiver>
<application><intent-filer>
<meta-data>BroadcastReceiver
subclass) as one of the application's components. Broadcast receivers enable
applications to receive intents that are broadcast by the system or by other
applications, even when other components of the application are not running.
There are two ways to make a broadcast receiver known to the system: One is
declare it in the manifest file with this element. The other is to create
the receiver dynamically in code and register it with the
method. See the Context.registerReceiver()BroadcastReceiver class description
for more on dynamically created receivers.
시스템에게 브로드캐스트 리시버를 알리기 위한 두 가지 방법이 있다: 하나는 이 엘리먼트를 가지고 매니페스트 파일 안에 그것을 선언하는 것이다. 다른 하나는 코드 안에서 동적으로 리시버를 만들어서 Context.registerReceiver() 메쏘드를 사용해서 그것을 등록하는 것이다. 동적으로 만들어진 리시버에 대한 더 많은 것은 BroadcastReceiver 클래스 설명을 보라.
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 broadcast receivers. The
<application> and
<receiver> attributes must both be "true" for
the broadcast receiver to be enabled. If either is "false", it is
disabled; it cannot be instantiated.
<application> 엘리먼트는 브로드캐스트 리시버를 포함하는 모든 애플리케이션 컴포넌트들에게 적용되는 그것 자신의 enabled 애트리뷰트를 갖는다. 브로드캐스트 리시버가 활성화될 수 있게 하기 위해서는 <application>과 <receiver> 애트리뷰트 모두가 “참true”이 되어야 한다. 만약 어느 것 하나가 “거짓false”이라면, 그것은 비활성화된다; 그것은 인스턴스화될 수 없다.
android:exportedtrue" if it can, and "false"
if not. If "false", the only messages the broadcast receiver can
receive are those sent by components of the same application or applications
with the same user ID.
The default value depends on whether the broadcast receiver contains intent filters.
The absence of any filters means that it can be invoked only by Intent objects that
specify its exact class name. This implies that the receiver is intended only for
application-internal use (since others would not normally 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 broadcast
receiver is intended to receive intents broadcast by the system or other applications,
so the default value is "true".
This attribute is not the only way to limit a broadcast receiver's external exposure.
You can also use a permission to limit the external entities that can send it messages
(see the permission attribute).
디폴트 값은 브로드캐스트 리시버가 인텐트 필터를 포함하는 지 여부에 따라 다르다. 아무 필터도 없다는 것은 그 리시버가 그것의 정확한 클래스 이름을 지정하는 인텐트 오브젝트에 의해서만 호출될 수 있다는 것을 의미한다. 이것은 (다른 것들이 일반적으로 클래스 이름을 모를 것이기 때문에) 리시버가 애플리케이션 내부 용도를 위해서만 의도되었다는 것을 의미한다. 그러므로 이런 경우에, 디폴트 값은 “거짓false”이다. 반면에, 최소한 하나의 필터가 있다는 것은 브로드캐스트 리시버가 시스템 또는 다른 애플리케이션의 브로드캐스트된 인텐트를 받도록 의도되었다는 것을 의미한다. 그러므로 디폴트 값은 “참true”이다.
이 애트리뷰트가 브로드캐스트 리시버의 외부 노출을 제한하는 유일한 방법은 아니다. 여러분은 또한 그 브로드캐스트리시버에 메시지를 보낼 수 있는 외부 엔티티를 제한하는 퍼미션을 사용할 수 있다(permission 애트리뷰트를 보라).
android:icon<application>
element's icon attribute).
The broadcast receiver's icon whether set here or by the
<application> element is also the
default icon for all the receiver's intent filters (see the
<intent-filter> element's
icon attribute).
브로드캐스트 리시버의 아이콘은 - 여기 또는 <application> 엘리먼트에서 설정되던 상관없이 - 모든 리시버의 인텐트 필터에 대한 디폴트 아이콘이다(<intent-filter> 엘리먼트의 icon 애트리뷰트를 보라).
android:label<application> element's
label attribute).
The broadcast receiver's label whether set here or by the
<application> element is also the
default label for all the receiver'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:nameBroadcastReceiver. This should be a fully qualified
class name (such as, "com.example.project.ReportReceiver"). However,
as a shorthand, if the first character of the name is a period (for example,
". ReportReceiver"), it is appended to the package name specified in
the <manifest> element.
There is no default. The name must be specified.
디폴트는 없다. 이름은 지정되어야 한다.
android:permission<application> element's
permission attribute applies
to the broadcast receiver. If neither attribute is set, the receiver
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.
퍼미션에 관한 더 많은 정보에 대해서, 앞에 나왔던 퍼미션 섹션과 8장. 보안과 퍼미션을 보라.
android:process<application> element's
process attribute can set a different
default for all components. But each 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 broadcast receiver runs in that process. If the process name begins with a lowercase character, the receiver 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인 신규 프로세스가 필요할 때 생성되며, 브로드캐스트 리시버는 그 프로세스에서 실행된다. 만약 프로세스 이름이 소문자로 시작된다면, 리시버는 그 이름을 가지는 글로벌 프로세스에서 실행되며, 이것은 그렇게 하도록 하는 퍼미션을 가지는 경우에 가능하다. 이것은 다른 애플리케이션의 컴포넌트들이 하나의 프로세스를 공유하게 하며, 리소스 사용을 감소시킨다.