1page.title=アプリ マニフェスト 2@jd:body 3 4<div id="qv-wrapper"> 5<div id="qv"> 6 7<h2>本書の内容</h2> 8<ol> 9<li><a href="#filestruct">マニフェスト ファイルの構造</a></li> 10<li><a href="#filec">ファイルの規則</a> 11<li><a href="#filef">ファイルの特徴</a> 12 <ol> 13 <li><a href="#ifs">インテント フィルタ</a></li> 14 <li><a href="#iconlabel">アイコンとラベル</a></li> 15 <li><a href="#perms">パーミッション</a></li> 16 <li><a href="#libs">ライブラリ</a></li> 17 </ol></li> 18</ol> 19</div> 20</div> 21 22<p> 23 すべてのアプリケーションには、そのルート ディレクトリに AndroidManifest.xml ファイル(名前はこのまま)が必要です。 24 <span itemprop="description">マニフェスト ファイルはアプリに関する重要な情報を Android システムに提示します。これは、システムがアプリのコードを実行する前に必要な情報です。 25 26 27</span> その他、マニフェスト ファイルでは次のことを行います。 28</p> 29 30<ul> 31<li>アプリケーションの Java パッケージ名を指定します。パッケージ名は、アプリケーションの一意の識別子としての機能を果たします。 32</li> 33 34<li>アプリケーションのコンポーネント(アプリケーションを構成するアクティビティ、サービス、ブロードキャスト レシーバー、コンテンツ プロバイダ)を記述します。 35 36各コンポーネントを実装するクラスの名前を指定し、その機能(対応可能な {@link android.content.Intent Intent} メッセージなど)を公開します。 37 38これらの宣言によって、Android システムは、どんなコンポーネントがあり、それらのコンポーネントがどのような条件で起動されるのかを把握できます。 39</li> 40 41<li>アプリケーション コンポーネントをホストするプロセスを決定します。</li> 42 43<li>アプリケーションが API の保護された部分にアクセスしたり他のアプリケーションとやり取りしたりする際に必要となるパーミッションを宣言します。 44</li> 45 46<li>他のアプリケーションがアプリケーションのコンポーネントとやり取りするために必要なパーミッションを宣言します。 47</li> 48 49<li>アプリケーションの実行時にプロファイリングやその他の情報を提供する {@link android.app.Instrumentation} クラスを記載します。 50これらの宣言は、アプリケーションの開発時やテスト時にのみマニフェストに含まれ、アプリケーションの公開前に削除されます。 51 52</li> 53 54<li>アプリケーションに必要な Android API の最小限のレベルを宣言します。 55</li> 56 57<li>アプリケーションにリンクする必要があるライブラリを記載します。</li> 58</ul> 59 60 61<h2 id="filestruct">マニフェスト ファイルの構造</h2> 62 63<p> 64次の図は、マニフェスト ファイルの一般的な構造とファイルに含むことができるすべてのエレメントを示します。 65各エレメントとそれぞれの属性はすべて別のファイルに記述されます。 66エレメントの詳細を見るには、図中、図の下にあるアルファベット順のエレメント一覧、またはその他の説明文に表示されているエレメント名をクリックしてください。 67 68 69 70</p> 71 72<pre> 73<?xml version="1.0" encoding="utf-8"?> 74 75<a href="{@docRoot}guide/topics/manifest/manifest-element.html"><manifest></a> 76 77 <a href="{@docRoot}guide/topics/manifest/uses-permission-element.html"><uses-permission /></a> 78 <a href="{@docRoot}guide/topics/manifest/permission-element.html"><permission /></a> 79 <a href="{@docRoot}guide/topics/manifest/permission-tree-element.html"><permission-tree /></a> 80 <a href="{@docRoot}guide/topics/manifest/permission-group-element.html"><permission-group /></a> 81 <a href="{@docRoot}guide/topics/manifest/instrumentation-element.html"><instrumentation /></a> 82 <a href="{@docRoot}guide/topics/manifest/uses-sdk-element.html"><uses-sdk /></a> 83 <a href="{@docRoot}guide/topics/manifest/uses-configuration-element.html"><uses-configuration /></a> <!-- ##api level 3## --> 84 <a href="{@docRoot}guide/topics/manifest/uses-feature-element.html"><uses-feature /></a> <!-- ##api level 4## --> 85 <a href="{@docRoot}guide/topics/manifest/supports-screens-element.html"><supports-screens /></a> <!-- ##api level 4## --> 86 <a href="{@docRoot}guide/topics/manifest/compatible-screens-element.html"><compatible-screens /></a> <!-- ##api level 9## --> 87 <a href="{@docRoot}guide/topics/manifest/supports-gl-texture-element.html"><supports-gl-texture /></a> <!-- ##api level 11## --> 88 89 <a href="{@docRoot}guide/topics/manifest/application-element.html"><application></a> 90 91 <a href="{@docRoot}guide/topics/manifest/activity-element.html"><activity></a> 92 <a href="{@docRoot}guide/topics/manifest/intent-filter-element.html"><intent-filter></a> 93 <a href="{@docRoot}guide/topics/manifest/action-element.html"><action /></a> 94 <a href="{@docRoot}guide/topics/manifest/category-element.html"><category /></a> 95 <a href="{@docRoot}guide/topics/manifest/data-element.html"><data /></a> 96 <a href="{@docRoot}guide/topics/manifest/intent-filter-element.html"></intent-filter></a> 97 <a href="{@docRoot}guide/topics/manifest/meta-data-element.html"><meta-data /></a> 98 <a href="{@docRoot}guide/topics/manifest/activity-element.html"></activity></a> 99 100 <a href="{@docRoot}guide/topics/manifest/activity-alias-element.html"><activity-alias></a> 101 <a href="{@docRoot}guide/topics/manifest/intent-filter-element.html"><intent-filter></a> . . . <a href="{@docRoot}guide/topics/manifest/intent-filter-element.html"></intent-filter></a> 102 <a href="{@docRoot}guide/topics/manifest/meta-data-element.html"><meta-data /></a> 103 <a href="{@docRoot}guide/topics/manifest/activity-alias-element.html"></activity-alias></a> 104 105 <a href="{@docRoot}guide/topics/manifest/service-element.html"><service></a> 106 <a href="{@docRoot}guide/topics/manifest/intent-filter-element.html"><intent-filter></a> . . . <a href="{@docRoot}guide/topics/manifest/intent-filter-element.html"></intent-filter></a> 107 <a href="{@docRoot}guide/topics/manifest/meta-data-element.html"><meta-data/></a> 108 <a href="{@docRoot}guide/topics/manifest/service-element.html"></service></a> 109 110 <a href="{@docRoot}guide/topics/manifest/receiver-element.html"><receiver></a> 111 <a href="{@docRoot}guide/topics/manifest/intent-filter-element.html"><intent-filter></a> . . . <a href="{@docRoot}guide/topics/manifest/intent-filter-element.html"></intent-filter></a> 112 <a href="{@docRoot}guide/topics/manifest/meta-data-element.html"><meta-data /></a> 113 <a href="{@docRoot}guide/topics/manifest/receiver-element.html"></receiver></a> 114 115 <a href="{@docRoot}guide/topics/manifest/provider-element.html"><provider></a> 116 <a href="{@docRoot}guide/topics/manifest/grant-uri-permission-element.html"><grant-uri-permission /></a> 117 <a href="{@docRoot}guide/topics/manifest/meta-data-element.html"><meta-data /></a> 118 <a href="{@docRoot}guide/topics/manifest/path-permission-element.html"><path-permission /></a> 119 <a href="{@docRoot}guide/topics/manifest/provider-element.html"></provider></a> 120 121 <a href="{@docRoot}guide/topics/manifest/uses-library-element.html"><uses-library /></a> 122 123 <a href="{@docRoot}guide/topics/manifest/application-element.html"></application></a> 124 125<a href="{@docRoot}guide/topics/manifest/manifest-element.html"></manifest></a> 126</pre> 127 128<p> 129以下は、マニフェスト ファイルに含むことができるすべてのエレメントをアルファベット順に並べたものです。 130使用が許可されているのはこれらのエレメントのみです。独自のエレメントや属性は追加できません。 131 132</p> 133 134<p style="margin-left: 2em"> 135<code><a href="{@docRoot}guide/topics/manifest/action-element.html"><action></a></code> 136<br/><code><a href="{@docRoot}guide/topics/manifest/activity-element.html"><activity></a></code> 137<br/><code><a href="{@docRoot}guide/topics/manifest/activity-alias-element.html"><activity-alias></a></code> 138<br/><code><a href="{@docRoot}guide/topics/manifest/application-element.html"><application></a></code> 139<br/><code><a href="{@docRoot}guide/topics/manifest/category-element.html"><category></a></code> 140<br/><code><a href="{@docRoot}guide/topics/manifest/data-element.html"><data></a></code> 141<br/><code><a href="{@docRoot}guide/topics/manifest/grant-uri-permission-element.html"><grant-uri-permission></a></code> 142<br/><code><a href="{@docRoot}guide/topics/manifest/instrumentation-element.html"><instrumentation></a></code> 143<br/><code><a href="{@docRoot}guide/topics/manifest/intent-filter-element.html"><intent-filter></a></code> 144<br/><code><a href="{@docRoot}guide/topics/manifest/manifest-element.html"><manifest></a></code> 145<br/><code><a href="{@docRoot}guide/topics/manifest/meta-data-element.html"><meta-data></a></code> 146<br/><code><a href="{@docRoot}guide/topics/manifest/permission-element.html"><permission></a></code> 147<br/><code><a href="{@docRoot}guide/topics/manifest/permission-group-element.html"><permission-group></a></code> 148<br/><code><a href="{@docRoot}guide/topics/manifest/permission-tree-element.html"><permission-tree></a></code> 149<br/><code><a href="{@docRoot}guide/topics/manifest/provider-element.html"><provider></a></code> 150<br/><code><a href="{@docRoot}guide/topics/manifest/receiver-element.html"><receiver></a></code> 151<br/><code><a href="{@docRoot}guide/topics/manifest/service-element.html"><service></a></code> 152<br/><code><a href="{@docRoot}guide/topics/manifest/supports-screens-element.html"><supports-screens></a></code> <!-- ##api level 4## --> 153<br/><code><a href="{@docRoot}guide/topics/manifest/uses-configuration-element.html"><uses-configuration></a></code> <!-- ##api level 3## --> 154<br/><code><a href="{@docRoot}guide/topics/manifest/uses-feature-element.html"><uses-feature></a></code> <!-- ##api level 4## --> 155<br/><code><a href="{@docRoot}guide/topics/manifest/uses-library-element.html"><uses-library></a></code> 156<br/><code><a href="{@docRoot}guide/topics/manifest/uses-permission-element.html"><uses-permission></a></code> 157<br/><code><a href="{@docRoot}guide/topics/manifest/uses-sdk-element.html"><uses-sdk></a></code> 158</p> 159 160 161 162 163<h2 id="filec">ファイルの規則</h2> 164 165<p> 166マニフェスト ファイルに含まれるエレメントと属性には、通常、次の規則とルールが適用されます。 167 168</p> 169 170<dl> 171<dt><b>エレメント</b></dt> 172<dd>必須のエレメントは<code><a href="{@docRoot}guide/topics/manifest/manifest-element.html"><manifest></a></code> と <code><a href="{@docRoot}guide/topics/manifest/application-element.html"><application></a></code> のみです。両方のエレメントを提示する必要があり、使用できるのはそれぞれ 1 回のみです。 173 174 175その他のほとんどのエレメントは、複数回使ってもまったく使わなくてもかまいませんが、意味のあるマニフェストを行うにはいくつかのエレメントが必要です。 176 177 178 179 180<p> 181内容のあるエレメントには他のエレメントが含まれているためです。すべての値は属性によって設定され、エレメント内に文字データが設定されることはありません。 182 183</p> 184 185<p> 186同じレベルにあるエレメントに順番はありません。たとえば、<code><a href="{@docRoot}guide/topics/manifest/activity-element.html"><activity></a></code> や <code><a href="{@docRoot}guide/topics/manifest/provider-element.html"><provider></a></code>、<code><a href="{@docRoot}guide/topics/manifest/service-element.html"><service></a></code> エレメントは、どのような順で並べてもかまいません。 187 188 189 190(<code><a href="{@docRoot}guide/topics/manifest/activity-alias-element.html"><activity-alias></a></code> エレメントは例外となります。 191 192エイリアスとなっている <code><a href="{@docRoot}guide/topics/manifest/activity-element.html"><activity></a></code> のすぐ後に記述する必要があります)。 193 194 195</p></dd> 196 197<dt><b>属性</b></dt> 198<dd>正式には、すべての属性はオプションです。しかし、エレメントが目的を達成するために設定しなければならない属性もあります。 199このドキュメントはガイドとしてお使いください。 200真の意味でオプションの属性には、デフォルト値または指定がない場合の動作が記述されています。 201 202 203<p>ルートの <code><a href="{@docRoot}guide/topics/manifest/manifest-element.html"><manifest></a></code> エレメントの属性の一部を除き、すべての属性名は {@code android:} 接頭辞で始まります(例: {@code android:alwaysRetainTaskState})。 204 205 206この接頭辞は共通であるため、ドキュメントで属性が名前で参照されている場合は通常省略されます。 207 208</p></dd> 209 210<dt><b>クラス名の宣言</b></dt> 211<dd>多くのエレメントは Java オブジェクトと一致しています。これらのエレメントには、アプリケーション自体(<code><a href="{@docRoot}guide/topics/manifest/application-element.html"><application></a></code> エレメント)とその主要なコンポーネントであるアクティビティ(<code><a href="{@docRoot}guide/topics/manifest/activity-element.html"><activity></a></code>)、サービス(<code><a href="{@docRoot}guide/topics/manifest/service-element.html"><service></a></code>)、ブロードキャスト レシーバー(<code><a href="{@docRoot}guide/topics/manifest/receiver-element.html"><receiver></a></code>)やコンテンツ プロバイダ(<code><a href="{@docRoot}guide/topics/manifest/provider-element.html"><provider></a></code>)が含まれます。 212 213 214 215 216 217 218 219 220 221 222 223<p> 224サブクラスを定義する場合は、コンポーネント クラス({@link android.app.Activity}、{@link android.app.Service}、{@link android.content.BroadcastReceiver}、{@link android.content.ContentProvider})でいつも行うように、サブクラスは {@code name} 属性で宣言されます。 225 226 227この名前には、完全なパッケージ名を含む必要があります。 228たとえば、{@link android.app.Service} サブクラスの宣言は以下のようになります。 229 230</p> 231 232<pre><manifest . . . > 233 <application . . . > 234 <service android:name="com.example.project.SecretService" . . . > 235 . . . 236 </service> 237 . . . 238 </application> 239</manifest></pre> 240 241<p> 242ただし、簡素化する方法として、文字列の最初の文字がピリオドの場合、文字列はアプリケーションのパッケージ名に付加されます(<code><a href="{@docRoot}guide/topics/manifest/manifest-element.html"><manifest></a></code> エレメントの <code><a href="{@docRoot}guide/topics/manifest/manifest-element.html#package">package</a></code> 属性によって指定されるため)。 243 244 245 246 247以下は、上記のものと同じ内容です。 248</p> 249 250<pre><manifest package="com.example.project" . . . > 251 <application . . . > 252 <service android:name=".SecretService" . . . > 253 . . . 254 </service> 255 . . . 256 </application> 257</manifest></pre> 258 259<p> 260コンポーネントの開始時に、Android は名前が指定されたサブクラスのインスタンスを作成します。サブクラスが指定されていない場合は、基底クラスのインスタンスを作成します。 261 262</p></dd> 263 264<dt><b>複数の値</b></dt> 265<dd>1 つ以上の値が指定されている場合は、1 つのエレメントに複数の値が記載されているのではなく、エレメントが繰り返されているケースがほとんどです。 266たとえば、インテント フィルタには複数のアクションが記載されている場合があります。 267 268 269<pre><intent-filter . . . > 270 <action android:name="android.intent.action.EDIT" /> 271 <action android:name="android.intent.action.INSERT" /> 272 <action android:name="android.intent.action.DELETE" /> 273 . . . 274</intent-filter></pre></dd> 275 276<dt><b>リソースの値</b></dt> 277<dd>属性には、ユーザーに対して表示する値を含むものもあります。たとえば、アクティビティのラベルやアイコンです。 278これらの属性の値は、ローカライズされていなければならないため、リソースまたはテーマから設定する必要があります。 279リソースの値は、以下の形式で記述されます。 280</p> 281 282<p style="margin-left: 2em">{@code @[<i>package</i>:]<i>type</i>:<i>name</i>}</p> 283 284<p> 285リソースがアプリケーションと同じパッケージ内にある場合は package 名を省略できます。type はリソースのタイプ(「string」や「drawable」など)、name は特定のリソースの名前です。<i></i> 286<i></i> 287<i></i>次に例を示します。 288 289</p> 290 291<pre><activity android:icon="@drawable/smallPic" . . . ></pre> 292 293<p> 294テーマからの値も同様の方法で表記されますが、冒頭は '{@code @}' ではなく '{@code ?}' となります。 295 296</p> 297 298<p style="margin-left: 2em">{@code ?[<i>package</i>:]<i>type</i>:<i>name</i>} 299</p></dd> 300 301<dt><b>文字列の値</b></dt> 302<dd>属性値が文字列で文字をエスケープする場合はダブル バックスラッシュ('{@code \\}')を使う必要があります。たとえば、改行は '{@code \\n}'、Unicode の文字は '{@code \\uxxxx}' となります。 303 304</dd> 305</dl> 306 307 308<h2 id="filef">ファイルの特徴</h2> 309 310<p> 311以下のセクションでは、Android の機能がどのようにマニフェスト ファイルに反映されるのかを説明します。 312 313</p> 314 315 316<h3 id="ifs">インテント フィルタ</h3> 317 318<p> 319アプリケーションのコア コンポーネント(アクティビティ、サービス、ブロードキャスト レシーバー)はインテントによって開始されます。 320<i></i>インテントとは、目的とするアクションを記述している情報の束({@link android.content.Intent} オブジェクト)で、使用されるデータやアクションを実行するコンポーネントのカテゴリ、その他の関連する指示を含みます。 321 322 323Android は、インテントに対応する適切なコンポーネントを捜し出し、必要に応じて新しいインスタンスを起動し、それにインテント オブジェクトを渡します。 324 325 326 327</p> 328 329<p> 330コンポーネントはインテント フィルタを使ってその機能(対応できるインテントの種類)を通知します。 331<i></i>Android システムはコンポーネントを起動する前にコンポーネントが対応できるインテントを知っておく必要があるため、インテント フィルタはマニフェスト ファイルの <code><a href="{@docRoot}guide/topics/manifest/intent-filter-element.html"><intent-filter></a></code> エレメントで指定されます。 332 333 334 335コンポーネントは、それぞれが異なる機能を記述しているフィルタをいくつでも持つことができます。 336 337</p> 338 339<p> 340対象となるコンポーネントの名前を明示的に指定しているインテントは、コンポーネントを起動します。この場合、フィルタは適用されません。 341対象の名前が指定されていない場合は、コンポーネントのフィルタを通過したインテントのみがコンポーネントを起動できます。 342 343 344</p> 345 346<p> 347インテント フィルタに対してインテント オブジェクトをテストする方法については、「<a href="{@docRoot}guide/components/intents-filters.html">インテントとインテント フィルタ</a>」ドキュメントをご覧ください。 348 349 350 351</p> 352 353 354<h3 id="iconlabel">アイコンとラベル</h3> 355 356<p> 357エレメントは、小さなアイコンやテキスト ラベルをユーザーに表示するために、{@code icon} と {@code label} 属性を持つ場合があります。 358画面に長い説明文を表示するための {@code description} 属性を持つエレメントもあります。 359 360たとえば、<code><a href="{@docRoot}guide/topics/manifest/permission-element.html"><permission></a></code> エレメントはこれらすべての属性を持っています。これによって、アプリケーションがユーザーにパーミッションを付与するかどうかを尋ねる際に、ユーザーに対して、パーミッションを示すアイコン、パーミッションの名前、パーミッションについての説明文を提示できます。 361 362 363 364 365 366</p> 367 368<p> 369どの場合においても、属性を含むエレメントに設定されたアイコンとラベルが、そのすべてのサブエレメントの {@code icon} と {@code label} のデフォルト設定となります。 370そのため、<code><a href="{@docRoot}guide/topics/manifest/application-element.html"><application></a></code> エレメントに設定されたアイコンとラベルは、アプリケーションの各コンポーネントのデフォルトのアイコンとラベルとなります。 371 372 373同様に、コンポーネントに設定されたアイコンとラベルは、— <code><a href="{@docRoot}guide/topics/manifest/activity-element.html"><activity></a></code> エレメントのように — それぞれのコンポーネントの <code><a href="{@docRoot}guide/topics/manifest/intent-filter-element.html"><intent-filter></a></code> エレメントのデフォルト設定となります。 374 375 376 377 378<code><a href="{@docRoot}guide/topics/manifest/application-element.html"><application></a></code> エレメントにラベルを設定し、アクティビティとそのインテント フィルタに設定しない場合は、アプリケーション ラベルはアクティビティとインテント フィルタの両方のラベルとして取り扱われます。 379 380 381 382 383</p> 384 385<p> 386インテント フィルタに設定されるアイコンとラベルは、コンポーネントがユーザーに対して提示されるときはいつでも、そのフィルタにより通知されている機能を提供するコンポーネントを示すために使用されます。 387 388たとえば、「{@code android.intent.action.MAIN}」と「{@code android.intent.category.LAUNCHER}」が設定されているフィルタは、アプリケーションを起動するアクティビティを通知しています — つまり、アプリケーション ランチャーに表示されるということです。 389 390 391 392そのため、このフィルタに設定されているアイコンとラベルがランチャーに表示されるものとなります。 393 394</p> 395 396 397<h3 id="perms">パーミッション</h3> 398 399<p> 400パーミッションは、コードの一部や端末上のデータへのアクセスを制限する機能を提供します。<i></i> 401 誤用や悪用によってユーザーの利用を妨げたり有害な作用をもたらす恐れのある重要なデータやコードを保護したりするための制限を設定します。 402 403</p> 404 405<p> 406それぞれのパーミッションは一意のラベルで識別されています。通常、ラベルは制限されるアクションを示します。 407以下は、Android により定義されているパーミッションの例です。 408 409</p> 410 411<p style="margin-left: 2em">{@code android.permission.CALL_EMERGENCY_NUMBERS} 412<br/>{@code android.permission.READ_OWNER_DATA} 413<br/>{@code android.permission.SET_WALLPAPER} 414<br/>{@code android.permission.DEVICE_POWER}</p> 415 416<p> 4171 つの機能は、1 つのパーミッションでのみ保護できます。 418</p> 419 420<p> 421アプリケーションがパーミッションにより保護されている機能へのアクセスを必要としている場合は、<code><a href="{@docRoot}guide/topics/manifest/uses-permission-element.html"><uses-permission></a></code> エレメントをマニフェスト ファイルに記述し、そのパーミッションが必要であることを宣言する必要があります。 422 423 424これによって、アプリケーションが端末にインストールされた際に、インストーラーは、アプリケーションの証明書に署名した関係機関を確認し、場合によってはユーザーに尋ねることで、要求されたパーミッションを付与するかどうかを決定します。 425 426 427パーミッションが付与されると、アプリケーションは保護された機能を使用できるようになります。 428 429パーミッションが付与されなかった場合は、アプリケーションは機能にアクセスできず、ユーザーに通知が表示されることもありません。 430 431</p> 432 433<p> 434アプリケーションは、パーミッションを使って自身のコンポーネント(アクティビティ、サービス、ブロードキャスト レシーバー、コンテンツ プロバイダ)を保護することもできます。 435Android により定義されているパーミッション({@link android.Manifest.permission android.Manifest.permission} に記載)や他のアプリケーションにより宣言されたパーミッションであればどれでも使用できます。 436 437 438独自のパーミッションを定義することもできます。新しいパーミッションは、<code><a href="{@docRoot}guide/topics/manifest/permission-element.html"><permission></a></code> エレメントを使って宣言します。 439 440 441たとえば、次のようにアクティビティを保護できます。 442</p> 443 444<pre> 445<manifest . . . > 446 <permission android:name="com.example.project.DEBIT_ACCT" . . . /> 447 <uses-permission android:name="com.example.project.DEBIT_ACCT" /> 448 . . . 449 <application . . .> 450 <activity android:name="com.example.project.FreneticActivity" 451 android:permission="com.example.project.DEBIT_ACCT" 452 . . . > 453 . . . 454 </activity> 455 </application> 456</manifest> 457</pre> 458 459<p> 460この例では、{@code DEBIT_ACCT} パーミッションは <code><a href="{@docRoot}guide/topics/manifest/permission-element.html"><permission></a></code> エレメントで宣言されているだけではなく、その使用が <code><a href="{@docRoot}guide/topics/manifest/uses-permission-element.html"><uses-permission></a></code> エレメントで要求されている点に注意してください。 461 462 463 464 465アプリケーション自身によって保護が設定されている場合でも、アプリケーションの他のコンポーネントが保護されたアクティビティを起動するために、その使用を要求する必要があります。 466 467 468</p> 469 470<p> 471同じ例で、別の場所で宣言されたパーミッションに {@code permission} 属性が設定されている場合({@code android.permission.CALL_EMERGENCY_NUMBERS} など)は、<code><a href="{@docRoot}guide/topics/manifest/permission-element.html"><permission></a></code> エレメントを使って再度宣言する必要があります。 472 473 474 475 476その場合も <code><a href="{@docRoot}guide/topics/manifest/uses-permission-element.html"><uses-permission></a></code> でその使用を要求する必要があります。 477 478</p> 479 480<p> 481<code><a href="{@docRoot}guide/topics/manifest/permission-tree-element.html"><permission-tree></a></code> エレメントは、コードに定義されるパーミッションの集まりに対するネームスペースを宣言します。 482 483 484<code><a href="{@docRoot}guide/topics/manifest/permission-group-element.html"><permission-group></a></code> エレメントは、パーミッションのセットに対するラベル(マニフェスト ファイルに <code><a href="{@docRoot}guide/topics/manifest/permission-element.html"><permission></a></code> エレメントを使って宣言されたもの、その他の場所で宣言されたものの両方)を定義します。 485 486 487 488これは、ユーザーに提示される際のパーミッションのグループ分けのみに影響します。 489<code><a href="{@docRoot}guide/topics/manifest/permission-group-element.html"><permission-group></a></code> エレメントでは、パーミッションのグループへの所属は指定されません。グループ名のみが指定されます。 490 491 492パーミッションは、<code><a href="{@docRoot}guide/topics/manifest/permission-element.html"><permission></a></code> エレメントの <code><a href="{@docRoot}guide/topics/manifest/permission-element.html#pgroup">permissionGroup</a></code> 属性にグループ名を割り当てることによって、グループに配置されます。 493 494 495 496 497 498</p> 499 500 501<h3 id="libs">ライブラリ</h3> 502 503<p> 504すべてのアプリケーションはデフォルトの Android ライブラリにリンクされています。このライブラリには、Activity、Service、Intent、View、Button、Application、ContentProvider などの共通クラスを含む、アプリケーションをビルドするための基本パッケージが含まれています。 505 506 507 508</p> 509 510<p> 511しかし、独自のライブラリに含まれているパッケージもあります。開発中のアプリケーションがこれらのパッケージのコードを使用している場合は、該当するライブラリにリンクするよう明示的に求める必要があります。 512 513この場合は、マニフェスト ファイルに各ライブラリを指定する <code><a href="{@docRoot}guide/topics/manifest/uses-library-element.html"><uses-library></a></code> エレメントが別途含まれている必要があります。 514 515(ライブラリ名は該当するパッケージのドキュメントに記載されています)。 516 517</p> 518