- सिंटैक्स:
<permission-tree android:icon="drawable resource" android:label="string resource" android:name="string" />
- इसमें शामिल है:
<manifest>
- विवरण:
- अनुमतियों के ट्री के लिए मूल नाम का एलान करता है. यह ऐप्लिकेशन इस्तेमाल करने का समय
ट्री में सभी नामों का मालिकाना हक हो. यह डाइनैमिक तौर पर नई अनुमतियां जोड़ सकता है
पेड़ से संपर्क करने के लिए,
PackageManager.addPermission()
पर कॉल करें. पेड़ के नामों को इनके बीच अलग किया गया है पूर्णविराम ('.
'). उदाहरण के लिए, अगर बेस का नामcom.example.project.taxes
, नीचे दी गई अनुमतियां जोड़ा गया:com.example.project.taxes.CALCULATE
com.example.project.taxes.deductions.STORE_RECEIPTS
com.example.project.taxes.deductions.ACCESS_RECORDS
यह एलिमेंट किसी अनुमति के बारे में नहीं बताता, सिर्फ़ वह नेमस्पेस जिसमें अनुमतियां दी जा सकती हैं. अनुमतियों का एलान करने के बारे में ज़्यादा जानने के लिए, इसे देखें
<permission>
अभी तक किसी भी व्यक्ति ने चेक इन नहीं किया है एलिमेंट. - विशेषताएं:
android:icon
- ट्री में सभी अनुमतियों को दिखाने वाला आइकॉन. यह एट्रिब्यूट को ड्रॉबल के ऐसे संसाधन के रेफ़रंस के तौर पर सेट किया जाना चाहिए जिसमें इमेज शामिल हो परिभाषा शामिल नहीं है.
android:label
- ग्रुप के लिए ऐसा नाम जिसे उपयोगकर्ता आसानी से पढ़ सके. सुविधा के लिए, लेबल को डेवलपमेंट के दौरान सीधे रॉ स्ट्रिंग के तौर पर सेट किया जा सकता है. हालांकि, जब ऐप्लिकेशन प्रकाशित किए जाने के लिए तैयार हो, तो उसे में एक स्ट्रिंग संसाधन का संदर्भ शामिल हो, ताकि उसका स्थानीय भाषा में अनुवाद किया जा सके. स्ट्रिंग होती हैं.
android:name
- अनुमति ट्री के निचले हिस्से में मौजूद नाम. यह इस तरह काम करता है
ट्री में सभी अनुमतियों के नाम का प्रीफ़िक्स. Java-स्टाइल स्कोपिंग का इस्तेमाल करें
ताकि नाम यूनीक हो. नाम में इससे ज़्यादा होना चाहिए
के पाथ में अवधि से अलग किए गए दो सेगमेंट हैं. उदाहरण के लिए,
com.example.base
ठीक है, लेकिनcom.example
नहीं है.
- इसमें पेश किया गया:
- एपीआई लेवल 1
- यह भी देखें:
<permission>
<permission-group>
<uses-permission>
<अनुमति-पेड़>
इस पेज पर मौजूद कॉन्टेंट और कोड सैंपल कॉन्टेंट के लाइसेंस में बताए गए लाइसेंस के हिसाब से हैं. Java और OpenJDK, Oracle और/या इससे जुड़ी हुई कंपनियों के ट्रेडमार्क या रजिस्टर किए हुए ट्रेडमार्क हैं.
आखिरी बार 2025-07-27 (UTC) को अपडेट किया गया.
[[["समझने में आसान है","easyToUnderstand","thumb-up"],["मेरी समस्या हल हो गई","solvedMyProblem","thumb-up"],["अन्य","otherUp","thumb-up"]],[["वह जानकारी मौजूद नहीं है जो मुझे चाहिए","missingTheInformationINeed","thumb-down"],["बहुत मुश्किल है / बहुत सारे चरण हैं","tooComplicatedTooManySteps","thumb-down"],["पुराना","outOfDate","thumb-down"],["अनुवाद से जुड़ी समस्या","translationIssue","thumb-down"],["सैंपल / कोड से जुड़ी समस्या","samplesCodeIssue","thumb-down"],["अन्य","otherDown","thumb-down"]],["आखिरी बार 2025-07-27 (UTC) को अपडेट किया गया."],[],[],null,["# <permission-tree\u003e\n\nsyntax:\n:\n\n ```xml\n \u003cpermission-tree android:icon=\"drawable resource\"\n android:label=\"string resource\"\n android:name=\"string\" /\u003e\n ```\n\ncontained in:\n: [\u003cmanifest\u003e](/guide/topics/manifest/manifest-element)\n\ndescription:\n: Declares the base name for a tree of permissions. The application takes\n ownership of all names within the tree. It can dynamically add new permissions\n to the tree by calling [PackageManager.addPermission()](/reference/android/content/pm/PackageManager#addPermission(android.content.pm.PermissionInfo)).\n Names within the tree are separated by\n periods ('`.`'). For example, if the base name is\n `com.example.project.taxes`, permissions like the following might be\n added:\n\n `com.example.project.taxes.CALCULATE`\n\n `com.example.project.taxes.deductions.STORE_RECEIPTS`\n\n `com.example.project.taxes.deductions.ACCESS_RECORDS`\n\n\n This element doesn't declare a permission itself, only a\n namespace in which permissions can be placed. For more information about declaring permissions, see the\n [\u003cpermission\u003e](/guide/topics/manifest/permission-element)\n element.\n\nattributes:\n:\n\n `android:icon`\n : An icon representing all the permissions in the tree. This attribute\n must be set as a reference to a drawable resource containing the image\n definition.\n\n `android:label`\n : A user-readable name for the group. As a convenience, the label\n can be directly set as a raw string during development. However,\n when the application is ready to be published, set it as a\n reference to a string resource, so that it can be localized like other\n strings in the user interface.\n\n `android:name`\n : The name at the base of the permission tree. It serves as\n a prefix to all permission names in the tree. Use Java-style scoping\n so that the name is unique. The name must have more than\n two period-separated segments in its path. For example,\n `com.example.base` is OK, but `com.example` isn't.\n\nintroduced in:\n: API level 1\n\nsee also:\n: [\u003cpermission\u003e](/guide/topics/manifest/permission-element)\n\n [\u003cpermission-group\u003e](/guide/topics/manifest/permission-group-element)\n\n [\u003cuses-permission\u003e](/guide/topics/manifest/uses-permission-element)"]]