<provider android:authorities="list" android:enabled=["true" | "false"] android:exported=["true" | "false"] android:grantUriPermissions=["true" | "false"] android:icon="drawable resource" android:initOrder="integer" android:label="string resource" android:multiprocess=["true" | "false"] android:name="string" android:permission="string" android:process="string" android:readPermission="string" android:syncable=["true" | "false"] android:writePermission="string" > . . . </provider>
<application><meta-data>
<grant-uri-permission>
<path-permission />
ContentProvider that supplies structured
access to data managed by the application. All content providers that
are part of the application must be represented by <provider>
elements in the manifest file. The system cannot see, and therefore will
not run, any that are not declared. (You need to declare only
those content providers that you develop as part of your application,
not those developed by others that your application uses.)
The Android system identifies content providers by the authority part
of a content: URI. For example, suppose that the following URI
is passed to :
ContentResolver.query()
content://com.example.project.healthcareprovider/nurses/rn
The content: scheme identifies the data as belonging to a content
provider and the authority (com.example.project.healthcareprovider)
identifies the particular provider. The authority therefore must be unique.
Typically, as in this example, it's the fully qualified name of a
ContentProvider subclass. The path part of a URI may be used by a content
provider to identify particular data subsets, but those paths are not
declared in the manifest.
For information on using and developing content providers, see a separate document, Content Providers.
안드로이드 시스템은 content: URI의 권위authority 영역으로 컨텐트 프로바이더를 구분한다. 예를 들어 다음에 나오는 URI가 ContentResolver.query()에 전달된다고 가정하자.
content://com.example.project.healthcareprovider/nurses/rn
content: 스키마scheme는 그 데이터가 컨텐트 프로바이더에 속하는 것으로 간주하며, 권위authority(com.example.project.healthcareprovider)는 특정 프로바이더를 구분한다. 그러므로 권위authority는 고유해야 한다. 일반적으로 이 예제에서처럼, 권위authority는 ContentProvider 서브클래스에 대한 전체 이름이다. URI의 경로path 영역은 특정 데이터 서브셋subset을 구분하기 위해 컨텐트 프로바이더에 의해 사용될 수도 있다. 하지만 그 경로path는 매니페스트 안에 선언되지는 않는다.
컨텐트 프로바이더 사용과 개발에 관한 정보에 대해서는 7장. “컨텐트 프로바이더”를 보라.
android:authoritiescom.example.provider.cartoonprovider). Typically, it's the name
of the ContentProvider subclass.
There is no default. At least one authority must be specified.
디폴트는 없다. 적어도 하나의 권위authority가 지정되어야 한다.
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 content providers. The
<application> and <provider>
attributes must both be "true" (as they both
are by default) for the content provider to be enabled. If either is
"false", the provider is disabled; it cannot be instantiated.
<application> 엘리먼트는 컨텐트 프로바이더를 포함하여, 모든 애플리케이션 컴포넌트에 적용되는 그것 자신의 enabled 애트리뷰트를 가진다. 컨텐트 프로바이더가 활성화될 수 있게 하기 위해서는 <application>과 <provider> 애트리뷰트 둘 다 “참true”(디폴트로 그것들 모두가 그렇듯이)이 되어야 한다. 만약 둘 중 어느 하나가 “거짓false”이라면, 프로바이더는 비활성화된다; 그것은 인스턴스화 될 수 없다.
android:exportedtrue" if it can be, and "false" if not.
If "false", the provider is available only to components of the
same application or applications with the same user ID. The default value
is "true".
You can export a content provider but still limit access to it with the
permission attribute.
여러분은 컨텐트 프로바이더를 제공할 수 있지만 여전히 퍼미션 애트리뷰트를 가지고 그것에 대한 접근을 제한할 수 있다.
android:grantUriPermissionsreadPermission,
writePermission, and
permission attributes
"true" if permission can be granted, and "false" if not.
If "true", permission can be granted to any of the content
provider's data. If "false", permission can be granted only
to the data subsets listed in
<grant-uri-permission> subelements,
if any. The default value is "false".
Granting permission is a way of giving an application component one-time access to data protected by a permission. For example, when an e-mail message contains an attachment, the mail application may call upon the appropriate viewer to open it, even though the viewer doesn't have general permission to look at all the content provider's data.
In such cases, permission is granted by
and FLAG_GRANT_READ_URI_PERMISSION
flags in the Intent object that activates the component. For example, the
mail application might put FLAG_GRANT_WRITE_URI_PERMISSIONFLAG_GRANT_READ_URI_PERMISSION in the
Intent passed to Context.startActivity(). The permission is specific
to the URI in the Intent.
If you enable this feature, either by setting this attribute to "true"
or by defining <grant-uri-permission>
subelements, you must call
when a covered URI is deleted from
the provider.
Context.revokeUriPermission()
See also the <grant-uri-permission>
element.
퍼미션을 부여하는 것은 퍼미션에 의해 보호된 데이터에 대해 애플리케이션 컴포넌트에게 한 번의 접근을 제공하는 방법이다. 예를 들어 이메일 메시지가 첨부파일을 포함할 때, 메일 애플리케이션은 그것을 열기 위한 적절한 뷰어가 해당 컨텐트 프로바이더의 모든 데이터를 볼 수 있는 일반적인 퍼미션을 가지고 있지 않을 지라도 그 뷰어를 호출할 지 모른다.
그런 경우에, 그 컴포넌트를 활성화하는 인텐트 오브젝트 내의 FLAG_GRANT_READ_URI_PERMISSION과 FLAG_GRANT_WRITE_URI_PERMISSION 플래그에 의해 퍼미션이 부여된다. 예를 들어 메일 애플리케이션은 Context.startActivity에 전달되는 인텐트 내에 FLAG_GRANT_READ_URI_PERMISSION를 넣을 수 있다. 그 퍼미션은 인텐트에 있는 URI에 국한된다.
만약 여러분이 이 애트리뷰트를 “참true”로 설정하거나 또는 <grant-uri-permission> 서브엘리먼트를 정의함으로써 이 기능을 활성화한다면, 여러분은 부여한 URI가 프로바이더로부터 지워지게 될 때, Context.revokeUriPermission()을 호출해야 한다.
또한 <grant-uri-permission> 엘리먼트를 보라.
android:icon<application>
element's icon attribute).android:initOrderandroid:label<application> 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.
라벨은 사용자 인터페이스의 다른 문자열처럼 로컬라이즈 될 수 있도록 문자열 리소스에 대한 레퍼런스로 설정되어야 한다. 하지만 편의상 여러분이 애플리케이션을 개발하는 동안, 그것은 또한 원시 문자열로써 설정될 수 있다.
android:multiprocesstrue" if instances can run in multiple
processes, and "false" if not. The default value is "false".
Normally, a content provider is instantiated in the process of the
application that defined it. However, if this flag is set to "true",
the system can create an instance in every process where there's a client
that wants to interact withit, thus avoiding the overhead of interprocess
communication.
보통 컨텐트 프로바이더는 그것을 정의했던 애플리케이션 프로세스 안에서 인스턴스화 된다. 하지만 이 플래그가 “참true”으로 설정되면, 시스템은 그것과 상호작용하길 원하는 클라이언트가 있는 모든 프로세스 내에서 인스턴스를 생성할 수 있다. 따라서 프로세스 간 통신 오버헤드를 방지한다.
android:nameContentProvider. This should be a fully qualified
class name (such as, "com.example.project.TransportationProvider").
However, as a shorthand, if the first character of the name is a period,
it is appended to the package name specified in the
<manifest> element.
There is no default. The name must be specified.
디폴트는 없다. 이름은 반드시 지정되어야 한다.
android:permissionreadPermission and
writePermission attributes take precedence
over this one. If the readPermission
attribute is also set, it controls access for querying the content provider.
And if the writePermission attribute is set,
it controls access for modifying the provider's data.
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 activity runs in that process. If the process name begins with a lowercase character, the activity 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 신규 프로세스가 필요할 때 생성되며, 액티비티는 그 프로세스에서 실행된다. 만약 프로세스 이름이 소문자로 시작하면, 액티비티는 그 이름을 가지는 글로벌 프로세스 안에서 실행될 것이며 이는 그렇게 하도록 하는 퍼미션을 가지는 경우에 가능하다. 이것은 다른 애플리케이션에 있는 컴포넌트들이 프로세스를 공유하는 것을 가능하게 하며, 리소스 사용을 감소시킨다.
android:readPermissionpermission and
writePermission attributes.android:syncabletrue"
if it is to be synchronized, and "{@ code false}" if not.android:writePermissionpermission and
readPermission attributes.