blob: a35c5a13c29ac7e0a53ec30f3cc29e2c8fc0d32a [file] [log] [blame]
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001page.title=<manifest>
2@jd:body
3
4<dl class="xml">
5<dt>syntax:</dt>
6<dd><pre class="stx">&lt;manifest xmlns:<a href="#nspace">android</a>="http://schemas.android.com/apk/res/android"
7 <a href="#package">package</a>="<i>string</i>"
8 android:<a href="#uid">sharedUserId</a>="<i>string</i>"
Dirk Dougherty9c3209d2009-04-18 22:01:18 -07009 android:<a href="#uidlabel">sharedUserLabel</a>="<i>string resource</i>" <!-- ##api level 3## -->
The Android Open Source Project9066cfe2009-03-03 19:31:44 -080010 android:<a href="#vcode">versionCode</a>="<i>integer</i>"
Scott Mainc861a5d2010-04-05 15:47:54 -070011 android:<a href="#vname">versionName</a>="<i>string</i>"
12 android:<a href="#install">installLocation</a>=["auto" | "internalOnly" | "preferExternal"] &gt;
The Android Open Source Project9066cfe2009-03-03 19:31:44 -080013 . . .
14&lt;/manifest&gt;</pre></dd>
15
16<p>
17<dt>contained in:</dt>
18<dd><i>none</i></dd>
19
20<p>
21<p>
22<dt>must contain:</dt>
23<dd><code><a href="{@docRoot}guide/topics/manifest/application-element.html">&lt;application&gt;</a></code></dd>
24
25<dt>can contain:</dt>
26<dd><code><a href="{@docRoot}guide/topics/manifest/instrumentation-element.html">&lt;instrumentation&gt;</a></code>
27<br/><code><a href="{@docRoot}guide/topics/manifest/permission-element.html">&lt;permission&gt;</a></code>
28<br/><code><a href="{@docRoot}guide/topics/manifest/permission-group-element.html">&lt;permission-group&gt;</a></code>
29<br/><code><a href="{@docRoot}guide/topics/manifest/permission-tree-element.html">&lt;permission-tree&gt;</a></code>
Dirk Dougherty9c3209d2009-04-18 22:01:18 -070030<br/><code><a href="{@docRoot}guide/topics/manifest/uses-configuration-element.html">&lt;uses-configuration&gt;</a></code> <!-- ##api level 3## -->
31<br/><code><a href="{@docRoot}guide/topics/manifest/uses-permission-element.html">&lt;uses-permission&gt;</a></code></dd>
Scott Main74577f72009-04-18 16:13:35 -070032<br/><code><a href="{@docRoot}guide/topics/manifest/uses-sdk-element.html">&lt;uses-sdk&gt;</a></code></dd>
The Android Open Source Project9066cfe2009-03-03 19:31:44 -080033
34<p>
35<dt>description:</dt>
36<dd>The root element of the AndroidManifest.xml file. It must
37contain an <code><a href="{@docRoot}guide/topics/manifest/application-element.html">&lt;application&gt;</a></code> element
38and specify {@code xlmns:android} and {@code package} attributes.</dd>
39
40<dt>attributes:</dt>
Scott Mainc861a5d2010-04-05 15:47:54 -070041<dd>
42<dl class="attr">
The Android Open Source Project9066cfe2009-03-03 19:31:44 -080043<dt><a name="nspace"></a>{@code xmlns:android}</dt>
44<dd>Defines the Android namespace. This attribute should always be set
45to "{@code http://schemas.android.com/apk/res/android}".</dd>
46
47<dt><a name="package"></a>{@code package}</dt>
48<dd>A full Java package name for the application. The name should
Kenny Roote2718202009-06-09 13:42:54 -050049be unique. The name may contain uppercase or lowercase letters ('A'
50through 'Z'), numbers, and underscores ('_'). However, individual
51package name parts may only start with letters. For example, applications
52published by Google could have names in the form
53<code>com.google.app.<i>application_name</i></code>.
The Android Open Source Project9066cfe2009-03-03 19:31:44 -080054
Scott Mainc861a5d2010-04-05 15:47:54 -070055 <p>
56 The package name serves as a unique identifier for the application.
57 It's also the default name for the application process (see the
58 <code><a href="{@docRoot}guide/topics/manifest/application-element.html">&lt;application&gt;</a></code>
59 element's
60 <code><a href="{@docRoot}guide/topics/manifest/application-element.html#aff">process</a></code>
61 process</a></code> attribute) and the default task affinity of an activity
62 (see the
63 <code><a href="{@docRoot}guide/topics/manifest/activity-element.html">&lt;activity&gt;</a></code>
64 element's
65 <code><a href="{@docRoot}guide/topics/manifest/activity-element.html#aff">taskAffinity</a></code> attribute).
66 </p>
67</dd>
The Android Open Source Project9066cfe2009-03-03 19:31:44 -080068
69<dt><a name="uid"></a>{@code android:sharedUserId}</dt>
70<dd>The name of a Linux user ID that will be shared with other applications.
71By default, Android assigns each application its own unique user ID.
72However, if this attribute is set to the same value for two or more applications,
73they will all share the same ID &mdash; provided that they are also signed
74by the same certificate. Application with the same user ID can access each
Dirk Dougherty9c3209d2009-04-18 22:01:18 -070075other's data and, if desired, run in the same process.</dd>
76
77<dt><a name="uidlabel"></a>{@code android:sharedUserLabel}</dt>
78<dd>A user-readable label for the shared user ID. The label must be set as
79a reference to a string resource; it cannot be a raw string.
80
Scott Mainc861a5d2010-04-05 15:47:54 -070081 <p>
82 <!-- ##api level indication## -->
83 This attribute was introduced in API Level 3. It is meaningful only if the
84 <code><a href="#uid">sharedUserId</a></code> attribute is also set.
85 </p>
86</dd>
The Android Open Source Project9066cfe2009-03-03 19:31:44 -080087
88<dt><a name="vcode"></a>{@code android:versionCode}</dt>
Scott Mainc861a5d2010-04-05 15:47:54 -070089<dd>An internal version number. This number is used only to determine whether
The Android Open Source Project9066cfe2009-03-03 19:31:44 -080090one version is more recent than another, with higher numbers indicating more
91recent versions. This is not the version number shown to users; that number
92is set by the {@code versionName} attribute.
93
Scott Mainc861a5d2010-04-05 15:47:54 -070094 <p>
95 The value must be set as an integer, such as "100". You can define it however
96 you want, as long as each successive version has a higher number. For example,
97 it could be a build number. Or you could translate a version number in "x.y"
98 format to an integer by encoding the "x" and "y" separately in the lower and
99 upper 16 bits. Or you could simply increase the number by one each time a new
100 version is released.
101 </p>
102</dd>
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800103
104<dt><a name="vname"></a>{@code android:versionName}</dt>
105<dd>The version number shown to users. This attribute can be set as a raw
106string or as a reference to a string resource. The string has no other purpose
107than to be displayed to users. The {@code versionCode} attribute holds
108the significant version number used internally.
Scott Mainc861a5d2010-04-05 15:47:54 -0700109</dd>
110
111<dt><a name="install"></a>{@code android:installLocation}</dt>
Scott Main76aafa42010-04-05 17:59:38 -0700112<dd>The default install location for the application.
Scott Mainc861a5d2010-04-05 15:47:54 -0700113
114<p>The following keyword strings are accepted:</p>
115
116<table>
117<tr>
118 <th>Value</th>
119 <th>Description</th>
120</tr><tr>
Scott Mainc861a5d2010-04-05 15:47:54 -0700121 <td>"{@code internalOnly}"</td>
Scott Mainc4c42ee2010-05-07 15:30:15 -0700122 <td>The application must be installed on the internal device storage only. If this is set,
123the application will never be installed on the external storage. If the internal
124storage is full, then the system will not install the application. This is also the default behavior
125if you do not define {@code android:installLocation}.</td>
126</tr><tr>
127 <td>"{@code auto}"</td>
128 <td>The application may be installed on the external storage, but the system will install the
129application on the internal storage by default. If the internal storage is full, then the system
130will install it on the external storage. Once installed, the user can move the application
131to either internal or external storage through the system settings.</td>
Scott Mainc861a5d2010-04-05 15:47:54 -0700132</tr><tr>
133 <td>"{@code preferExternal}"</td>
Scott Main76aafa42010-04-05 17:59:38 -0700134 <td>The application prefers to be installed on the external storage (SD card). There is no
135guarantee that the system will honor this request. The application might be installed on internal
136storage if the external media is unavailable or full, or if the application uses the forward-locking
Scott Mainc4c42ee2010-05-07 15:30:15 -0700137mechanism (not supported on external storage). Once installed, the user can move the application to
138either internal or external storage through the system settings.</td>
Scott Mainc861a5d2010-04-05 15:47:54 -0700139</tr>
140</table>
141
Scott Mainc4c42ee2010-05-07 15:30:15 -0700142<p class="note"><strong>Note:</strong> By default, your application will be installed on the
143internal storage and cannot be installed on the external storage unless you define this attribute
144to be either "{@code auto}" or "{@code preferExternal}".</p>
145
Scott Mainc861a5d2010-04-05 15:47:54 -0700146<p>When an application is installed on the external storage:</p>
147<ul>
148 <li>The {@code .apk} file is saved
149to the external storage, but any application data (such as databases) is still saved on
150the internal device memory.</li>
151 <li>The container in which the {@code .apk} file is saved is encrypted with a key that allows
152the application to operate only on the device that installed it. (A user cannot
153transfer the SD card to another device and use applications installed on the card.) Though,
154multiple SD cards can be used with the same device.</li>
155 <li>At the user's request, the application can be moved to the internal storage.</li>
156</ul>
157
158<p>The user may also request to move an application from the internal storage to the external
Scott Main76aafa42010-04-05 17:59:38 -0700159storage. However, the system will not allow the user to move the application to external storage if
Scott Mainc4c42ee2010-05-07 15:30:15 -0700160this attribute is set to {@code internalOnly}, which is the default setting.</p>
161
162<p>Introduced in: API Level 8.</p>
Scott Mainc861a5d2010-04-05 15:47:54 -0700163
Scott Main5cdf5fd2010-05-11 14:21:53 -0700164
Scott Mainc861a5d2010-04-05 15:47:54 -0700165</dd>
166
167</dl>
168</dd><!-- end attributes -->
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800169
Dirk Dougherty9c3209d2009-04-18 22:01:18 -0700170<!-- ##api level indication## -->
171<dt>introduced in:</dt>
Scott Main76aafa42010-04-05 17:59:38 -0700172<dd>API Level 1 for all attributes, unless noted otherwise in the attribute description.</dd>
Dirk Dougherty9c3209d2009-04-18 22:01:18 -0700173
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800174<p>
175<dt>see also:</dt>
Scott Mainc4c42ee2010-05-07 15:30:15 -0700176<dd><a href="{@docRoot}guide/appendix/install-location.html">App Install Location</a><br/>
177<code><a href="{@docRoot}guide/topics/manifest/application-element.html">&lt;application&gt;</a></code></dd>
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800178
179</dl>