- सिंटैक्स:
<grant-uri-permission android:path="string" android:pathPattern="string" android:pathPrefix="string" />
- इसमें शामिल है:
<provider>
- विवरण:
- यह ऐप्लिकेशन डेटा के सबसेट के बारे में बताता है, जिसे पैरंट कॉन्टेंट देने वाला
को ऐक्सेस करने की अनुमति है. डेटा के सबसेट, पाथ वाले हिस्से से दिखाए जाते हैं
content:
यूआरआई. यूआरआई का आधिकारिक हिस्सा, कॉन्टेंट देने वाला. अनुमति देना, सेवा देने वाली कंपनी के क्लाइंट को अनुमति देने का एक तरीका है, जो आमतौर पर अपने डेटा को ऐक्सेस करने की अनुमति होती है, ताकि और उन्हें पैसे चुकाने की ज़रूरत नहीं होती.अगर कॉन्टेंट देने वाले का
grantUriPermissions
विशेषताtrue
है, का अधिकार है. हालांकि, अगर वह एट्रिब्यूटfalse
है, तो अनुमति सिर्फ़ उन डेटा सबसेट को दिया जाता है जिन्हें इस एलिमेंट के ज़रिए तय किया जाता है. सेवा देने वाली कंपनी में, कई<grant-uri-permission>
एलिमेंट शामिल हो सकते हैं. हर पाथ तीन संभावित विशेषताओं में से किसी एक का इस्तेमाल करके, सिर्फ़ एक पाथ तय कर सकता है.अनुमति कैसे दी जाती है, इस बारे में जानकारी के लिए देखें
<intent-filter>
एलिमेंटgrantUriPermissions
एट्रिब्यूट की वैल्यू सबमिट करें. - विशेषताएं:
android:path
android:pathPrefix
android:pathPattern
- डेटा के सबसेट या सबसेट की पहचान करने वाला पाथ, जिसे अनुमति दी जा सकती है
इसके लिए दिया गया है.
path
एट्रिब्यूट एक पूरा पाथ बताता है. डेटा के सिर्फ़ उस सबसेट को अनुमति दी जा सकती है जिसकी पहचान की गई है उस पाथ से.pathPrefix
एट्रिब्यूट, पाथ के शुरुआती हिस्से के बारे में बताता है. डेटा के ऐसे सभी सबसेट को अनुमति दी जा सकती है जिनके साथ पाथ शेयर हो हिस्सा लेते हैं.pathPattern
एट्रिब्यूट एक पूरा पाथ बताता है, लेकिन एक इसमें ये वाइल्डकार्ड हो सकते हैं:- तारा चिह्न (
*
) शून्य के क्रम से कई बार मेल खाता है इसके ठीक पहले वाला वर्ण. तारे का निशान (
.*
) के बाद दिखने वाला पीरियड, इसके किसी भी क्रम से मेल खाता है शून्य या कई वर्ण इस्तेमाल किए जा सकते हैं.
क्योंकि स्ट्रिंग को पढ़े जाने पर
\
का इस्तेमाल एस्केप वर्ण के तौर पर किया जाता है एक्सएमएल से, इसे पैटर्न के तौर पर पार्स करने से पहले, आपको Double-escape करना होगा. उदाहरण के लिए, लिटरल*
को\\*
के तौर पर लिखा जाता है और लिटरल\
को\\\
के रूप में लिखा गया है.इस तरह के पैटर्न के बारे में ज़्यादा जानने के लिए,
PATTERN_LITERAL
,PATTERN_PREFIX
, औरPATTERN_SIMPLE_GLOB
PatternMatcher
क्लास. - तारा चिह्न (
- इसमें पेश किया गया:
- एपीआई लेवल 1
- यह भी देखें:
- अभी तक किसी भी व्यक्ति ने चेक इन नहीं किया है
grantUriPermissions
एट्रिब्यूट<provider>
एलिमेंट
<grant-uri-permission>
इस पेज पर मौजूद कॉन्टेंट और कोड सैंपल कॉन्टेंट के लाइसेंस में बताए गए लाइसेंस के हिसाब से हैं. Java और OpenJDK, Oracle और/या इससे जुड़ी हुई कंपनियों के ट्रेडमार्क या रजिस्टर किए हुए ट्रेडमार्क हैं.
आखिरी बार 2025-07-27 (UTC) को अपडेट किया गया.
[null,null,["आखिरी बार 2025-07-27 (UTC) को अपडेट किया गया."],[],[],null,["# <grant-uri-permission\u003e\n\nsyntax:\n:\n\n ```xml\n \u003cgrant-uri-permission android:path=\"string\"\n android:pathPattern=\"string\"\n android:pathPrefix=\"string\" /\u003e\n ```\n\ncontained in:\n: [\u003cprovider\u003e](/guide/topics/manifest/provider-element)\n\ndescription:\n: Specifies the subsets of app data that the parent content provider\n has permission to access. Data subsets are indicated by the path part of a\n `content:` URI. The authority part of the URI identifies the\n content provider.\n Granting permission is a way of enabling clients of the provider that don't\n normally have permission to access its data to overcome that restriction on\n a one-time basis.\n\n\n If a content provider's [grantUriPermissions](/guide/topics/manifest/provider-element#gprmsn)\n attribute is `true`, permission can be granted for any of the data under\n the provider's purview. However, if that attribute is `false`, permission\n is granted only to data subsets that are specified by this element.\n A provider can contain any number of `\u003cgrant-uri-permission\u003e` elements.\n Each one can specify only one path, using one of the three possible attributes.\n\n\n For information about how permission is granted, see the\n [\u003cintent-filter\u003e](/guide/topics/manifest/intent-filter-element) element's\n [grantUriPermissions](/guide/topics/manifest/provider-element#gprmsn) attribute.\n\nattributes:\n:\n\n `android:path`\n\n `android:pathPrefix`\n\n `android:pathPattern`\n : A path identifying the data subset or subsets that permission can be\n granted for. The `path` attribute specifies a complete path.\n Permission can granted only to the particular data subset identified\n by that path.\n\n \u003cbr /\u003e\n\n\n The `pathPrefix` attribute specifies the initial part of a path.\n Permission can be granted to all data subsets with paths that share that\n initial part.\n The `pathPattern` attribute specifies a complete path, but one\n that can contain the following wildcards:\n\n - An asterisk (`*`) matches a sequence of zero to many occurrences of the immediately preceding character.\n - A period followed by an asterisk (`.*`) matches any sequence of\n zero to many characters.\n\n\n Because `\\` is used as an escape character when the string is read\n from XML, before it is parsed as a pattern, you need to double-escape.\n For example, a literal `*` is written as `\\\\*` and a\n literal `\\` is written as `\\\\\\`.\n\n\n For more information about these types of patterns, see the descriptions of\n [PATTERN_LITERAL](/reference/android/os/PatternMatcher#PATTERN_LITERAL),\n [PATTERN_PREFIX](/reference/android/os/PatternMatcher#PATTERN_PREFIX), and\n [PATTERN_SIMPLE_GLOB](/reference/android/os/PatternMatcher#PATTERN_SIMPLE_GLOB) in the\n [PatternMatcher](/reference/android/os/PatternMatcher) class.\n\nintroduced in:\n: API level 1\n\nsee also:\n:\n [grantUriPermissions](/guide/topics/manifest/provider-element#gprmsn)\n attribute of the\n [\u003cprovider\u003e](/guide/topics/manifest/provider-element)\n element"]]