| The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 1 | page.title=<application> |
| Scott Main | 2a1b706 | 2011-02-22 14:43:41 -0800 | [diff] [blame] | 2 | parent.title=The AndroidManifest.xml File |
| 3 | parent.link=manifest-intro.html |
| The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 4 | @jd:body |
| 5 | |
| 6 | <dl class="xml"> |
| 7 | <dt>syntax:</dt> |
| Scott Main | 6e88c84 | 2010-11-04 18:45:05 -0700 | [diff] [blame] | 8 | <dd><pre class="stx"><application android:<a href="#reparent">allowTaskReparenting</a>=["true" | "false"] |
| Christopher Tate | 4e14a82 | 2010-04-08 12:54:23 -0700 | [diff] [blame] | 9 | android:<a href="#agent">backupAgent</a>="<i>string</i>" |
| The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 10 | android:<a href="#debug">debuggable</a>=["true" | "false"] |
| 11 | android:<a href="#desc">description</a>="<i>string resource</i>" |
| 12 | android:<a href="#enabled">enabled</a>=["true" | "false"] |
| 13 | android:<a href="#code">hasCode</a>=["true" | "false"] |
| Dirk Dougherty | 36d2d1b | 2011-02-20 00:40:38 -0800 | [diff] [blame] | 14 | android:<a href="#hwaccel">hardwareAccelerated</a>=["true" | "false"] |
| The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 15 | android:<a href="#icon">icon</a>="<i>drawable resource</i>" |
| Christopher Tate | 4e14a82 | 2010-04-08 12:54:23 -0700 | [diff] [blame] | 16 | android:<a href="#killrst">killAfterRestore</a>=["true" | "false"] |
| The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 17 | android:<a href="#label">label</a>="<i>string resource</i>" |
| Scott Main | c18b534 | 2010-08-17 11:48:09 -0700 | [diff] [blame] | 18 | android:<a href="#logo">logo</a>="<i>drawable resource</i>" |
| The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 19 | android:<a href="#space">manageSpaceActivity</a>="<i>string</i>" |
| 20 | android:<a href="#nm">name</a>="<i>string</i>" |
| 21 | android:<a href="#prmsn">permission</a>="<i>string</i>" |
| 22 | android:<a href="#persistent">persistent</a>=["true" | "false"] |
| 23 | android:<a href="#proc">process</a>="<i>string</i>" |
| Christopher Tate | 4e14a82 | 2010-04-08 12:54:23 -0700 | [diff] [blame] | 24 | android:<a href="#restoreany">restoreAnyVersion</a>=["true" | "false"] |
| The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 25 | android:<a href="#aff">taskAffinity</a>="<i>string</i>" |
| Scott Main | 084369f | 2011-10-20 20:12:21 -0700 | [diff] [blame^] | 26 | android:<a href="#theme">theme</a>="<i>resource or theme</i>" |
| 27 | android:<a href="#uioptions">uiOptions</a>=["none" | "splitActionBarWhenNarrow"] > |
| The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 28 | . . . |
| 29 | </application></pre></dd> |
| 30 | |
| 31 | <dt>contained in:</dt> |
| 32 | <dd><code><a href="{@docRoot}guide/topics/manifest/manifest-element.html"><manifest></a></code></dd> |
| 33 | |
| 34 | <dt>can contain:</dt> |
| 35 | <dd><code><a href="{@docRoot}guide/topics/manifest/activity-element.html"><activity></a></code> |
| 36 | <br/><code><a href="{@docRoot}guide/topics/manifest/activity-alias-element.html"><activity-alias></a></code> |
| 37 | <br/><code><a href="{@docRoot}guide/topics/manifest/service-element.html"><service></a></code> |
| 38 | <br/><code><a href="{@docRoot}guide/topics/manifest/receiver-element.html"><receiver></a></code> |
| 39 | <br/><code><a href="{@docRoot}guide/topics/manifest/provider-element.html"><provider></a></code> |
| 40 | <br/><code><a href="{@docRoot}guide/topics/manifest/uses-library-element.html"><uses-library></a></code></dd> |
| 41 | |
| 42 | <dt>description:</dt> |
| 43 | <dd>The declaration of the application. This element contains subelements |
| 44 | that declare each of the application's components and has attributes |
| 45 | that can affect all the components. Many of these attributes (such as |
| 46 | {@code icon}, {@code label}, {@code permission}, {@code process}, |
| 47 | {@code taskAffinity}, and {@code allowTaskReparenting}) set default values |
| 48 | for corresponding attributes of the component elements. Others (such as |
| 49 | {@code debuggable}, {@code enabled}, {@code description}, and |
| 50 | {@code allowClearUserData}) set values for the application as a whole and |
| 51 | cannot be overridden by the components.</dd> |
| 52 | |
| 53 | <dt>attributes</dt> |
| 54 | <dd><dl class="attr"> |
| Christopher Tate | 4e14a82 | 2010-04-08 12:54:23 -0700 | [diff] [blame] | 55 | |
| The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 56 | <dt><a name="reparent"></a>{@code android:allowTaskReparenting}</dt> |
| 57 | <dd>Whether or not activities that the application defines can move from |
| 58 | the task that started them to the task they have an affinity for when that task |
| 59 | is next brought to the front — "{@code true}" if they can move, and |
| 60 | "{@code false}" if they must remain with the task where they started. |
| 61 | The default value is "{@code false}". |
| 62 | |
| 63 | <p> |
| 64 | The |
| 65 | <code><a href="{@docRoot}guide/topics/manifest/activity-element.html"><activity></a></code> |
| 66 | element has its own |
| 67 | <code><a href="{@docRoot}guide/topics/manifest/activity-element.html#reparent">allowTaskReparenting</a></code> |
| 68 | attribute that can override the value set here. See that attribute for more |
| 69 | information. |
| 70 | </p></dd> |
| 71 | |
| Christopher Tate | 4e14a82 | 2010-04-08 12:54:23 -0700 | [diff] [blame] | 72 | <dt><a name="agent"></a>{@code android:backupAgent}</dt> |
| 73 | <dd>The name of the class that implement's the application's backup agent, |
| 74 | a subclass of {@link android.app.backup.BackupAgent}. The attribute value should be |
| 75 | a fully qualified class name (such as, "{@code com.example.project.MyBackupAgent}"). |
| 76 | However, as a shorthand, if the first character of the name is a period |
| 77 | (for example, "{@code .MyBackupAgent}"), it is appended to the |
| 78 | package name specified in the |
| 79 | <code><a href="{@docRoot}guide/topics/manifest/manifest-element.html"><manifest></a></code> |
| 80 | element. |
| 81 | |
| 82 | <p> |
| 83 | There is no default. The name must be specified. |
| 84 | </p></dd> |
| 85 | |
| The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 86 | <dt><a name="debug"></a>{@code android:debuggable}</dt> |
| 87 | <dd>Whether or not the application can be debugged, even when running |
| 88 | on a device in user mode — "{@code true}" if it can be, and "{@code false}" |
| 89 | if not. The default value is "{@code false}".</dd> |
| 90 | |
| 91 | <dt><a name="desc"></a>{@code android:description}</dt> |
| 92 | <dd>User-readable text about the application, longer and more descriptive than the application label. The value must be set as a reference to a string resource. Unlike the label, it cannot be a raw string. There is no default value.</dd> |
| 93 | |
| 94 | <dt><a name="enabled"></a>{@code android:enabled}</dt> |
| 95 | <dd>Whether or not the Android system can instantiate components of |
| 96 | the application — "{@code true}" if it can, and "{@code false}" |
| 97 | if not. If the value is "{@code true}", each component's |
| 98 | {@code enabled} attribute determines whether that component is enabled |
| 99 | or not. If the value is "{@code false}", it overrides the |
| 100 | component-specific values; all components are disabled. |
| 101 | |
| 102 | <p> |
| 103 | The default value is "{@code true}". |
| 104 | </p></dd> |
| 105 | |
| 106 | <dt><a name="code"></a>{@code android:hasCode}</dt> |
| 107 | <dd>Whether or not the application contains any code — "{@code true}" |
| 108 | if it does, and "{@code false}" if not. When the value is "{@code false}", |
| 109 | the system does not try to load any application code when launching components. |
| 110 | The default value is "{@code true}". |
| 111 | |
| 112 | <p> |
| 113 | An application would not have any code of its own only if it's using nothing |
| 114 | but built-in component classes, such as an activity that uses the {@link |
| Dirk Dougherty | 36d2d1b | 2011-02-20 00:40:38 -0800 | [diff] [blame] | 115 | android.app.AliasActivity} class, a rare occurrence.</p> |
| 116 | </dd> |
| 117 | |
| 118 | <dt><a name="hwaccel"></a>{@code android:hardwareAccelerated}</dt> |
| 119 | <dd>Whether or not hardware-accelerated rendering should be enabled for all |
| 120 | Activities and Views in this application — "{@code true}" if it |
| 121 | should be enabled, and "{@code false}" if not. The default value is "{@code false}". |
| 122 | |
| 123 | <p>Starting from Android 3.0, a hardware-accelerated OpenGL renderer is |
| 124 | available to applications, to improve performance for many common 2D graphics |
| 125 | operations. When the hardware-accelerated renderer is enabled, most operations |
| 126 | in Canvas, Paint, Xfermode, ColorFilter, Shader, and Camera are accelerated. |
| 127 | This results in smoother animations, smoother scrolling, and improved |
| 128 | responsiveness overall, even for applications that do not explicitly make use |
| 129 | the framework's OpenGL libraries. </p> |
| 130 | |
| 131 | <p>Note that not all of the OpenGL 2D operations are accelerated. If you enable |
| 132 | the hardware-accelerated renderer, test your application to ensure that it can |
| 133 | make use of the renderer without errors.</p> |
| 134 | </dd> |
| The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 135 | |
| 136 | <dt><a name="icon"></a>{@code android:icon}</dt> |
| 137 | <dd>An icon for the application as whole, and the default icon for |
| 138 | each of the application's components. See the individual |
| 139 | {@code icon} attributes for |
| 140 | <code><a href="{@docRoot}guide/topics/manifest/activity-element.html"><activity></a></code>, |
| 141 | <code><a href="{@docRoot}guide/topics/manifest/activity-alias-element.html"><activity-alias></a></code>, |
| 142 | <code><a href="{@docRoot}guide/topics/manifest/service-element.html"><service></a></code>, |
| 143 | <code><a href="{@docRoot}guide/topics/manifest/receiver-element.html"><receiver></a></code>, and |
| 144 | <code><a href="{@docRoot}guide/topics/manifest/provider-element.html"><provider></a></code> elements. |
| 145 | |
| 146 | <p> |
| 147 | This attribute must be set as a reference to a drawable resource containing |
| Scott Main | c18b534 | 2010-08-17 11:48:09 -0700 | [diff] [blame] | 148 | the image (for example {@code "@drawable/icon"}). There is no default icon. |
| The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 149 | </p></dd> |
| 150 | |
| Christopher Tate | 4e14a82 | 2010-04-08 12:54:23 -0700 | [diff] [blame] | 151 | <dt><a name="killrst"></a>{@code android:killAfterRestore}</dt> |
| 152 | <dd>Whether the application in question should be terminated after its |
| 153 | settings have been restored during a full-system restore operation. |
| 154 | Single-package restore operations will never cause the application to |
| 155 | be shut down. Full-system restore operations typically only occur once, |
| 156 | when the phone is first set up. Third-party applications will not normally |
| 157 | need to use this attribute. |
| 158 | |
| 159 | <p>The default is {@code true}, which means that after the application |
| 160 | has finished processing its data during a full-system restore, it will be |
| 161 | terminated. |
| 162 | </p></dd> |
| 163 | |
| The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 164 | <dt><a name="label"></a>{@code android:label}</dt> |
| 165 | <dd>A user-readable label for the application as a whole, and a default |
| 166 | label for each of the application's components. See the individual |
| 167 | {@code label} attributes for |
| 168 | <code><a href="{@docRoot}guide/topics/manifest/activity-element.html"><activity></a></code>, |
| 169 | <code><a href="{@docRoot}guide/topics/manifest/activity-alias-element.html"><activity-alias></a></code>, |
| 170 | <code><a href="{@docRoot}guide/topics/manifest/service-element.html"><service></a></code>, |
| 171 | <code><a href="{@docRoot}guide/topics/manifest/receiver-element.html"><receiver></a></code>, and |
| 172 | <code><a href="{@docRoot}guide/topics/manifest/provider-element.html"><provider></a></code> elements. |
| 173 | |
| 174 | <p> |
| 175 | The label should be set as a reference to a string resource, so that |
| 176 | it can be localized like other strings in the user interface. |
| 177 | However, as a convenience while you're developing the application, |
| 178 | it can also be set as a raw string. |
| 179 | </p></dd> |
| 180 | |
| Scott Main | c18b534 | 2010-08-17 11:48:09 -0700 | [diff] [blame] | 181 | <dt><a name="logo"></a>{@code android:logo}</dt> |
| 182 | <dd>A logo for the application as whole, and the default logo for activities. |
| 183 | <p>This attribute must be set as a reference to a drawable resource containing |
| 184 | the image (for example {@code "@drawable/logo"}). There is no default logo.</p></dd> |
| 185 | |
| The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 186 | <dt><a name="space"></a>{@code android:manageSpaceActivity}</dt> |
| 187 | <dd>The fully qualified name of an Activity subclass that the system |
| 188 | can launch to let users manage the memory occupied by the application |
| 189 | on the device. The activity should also be declared with an |
| 190 | <code><a href="{@docRoot}guide/topics/manifest/activity-element.html"><activity></a></code> element. |
| 191 | </dd> |
| 192 | |
| 193 | <dt><a name="nm"></a>{@code android:name}</dt> |
| 194 | <dd>The fully qualified name of an {@link android.app.Application} |
| 195 | subclass implemented for the application. When the application process |
| 196 | is started, this class is instantiated before any of the application's |
| 197 | components. |
| 198 | |
| 199 | <p> |
| 200 | The subclass is optional; most applications won't need one. |
| 201 | In the absence of a subclass, Android uses an instance of the base |
| 202 | Application class. |
| 203 | </p></dd> |
| 204 | |
| 205 | <dt><a name="prmsn"></a>{@code android:permission}</dt> |
| 206 | <dd>The name of a permission that clients must have in order to interact |
| 207 | with the application. This attribute is a convenient way to set a |
| 208 | permission that applies to all of the application's components. It can |
| 209 | be overwritten by setting the {@code permission} attributes of individual |
| 210 | components. |
| 211 | |
| 212 | <p> |
| 213 | For more information on permissions, see the |
| 214 | <a href="{@docRoot}guide/topics/manifest/manifest-intro.html#sectperm">Permissions</a> |
| 215 | section in the introduction and another document, |
| 216 | <a href="{@docRoot}guide/topics/security/security.html">Security and |
| 217 | Permissions</a>. |
| 218 | </p></dd> |
| 219 | |
| 220 | <dt><a name="persistent"></a>{@code android:persistent}</dt> |
| 221 | <dd>Whether or not the application should remain running at all times — |
| 222 | "{@code true}" if it should, and "{@code false}" if not. The default value |
| 223 | is "{@code false}". Applications should not normally set this flag; |
| 224 | persistence mode is intended only for certain system applications.</dd> |
| 225 | |
| 226 | <dt><a name="proc"></a>{@code android:process}</dt> |
| 227 | <dd>The name of a process where all components of the application should run. |
| 228 | Each component can override this default by setting its own {@code process} |
| 229 | attribute. |
| 230 | |
| 231 | <p> |
| 232 | By default, Android creates a process for an application when the first |
| 233 | of its components needs to run. All components then run in that process. |
| 234 | The name of the default process matches the package name set by the |
| 235 | <code><a href="{@docRoot}guide/topics/manifest/manifest-element.html"><manifest></a></code> element. |
| 236 | </p> |
| 237 | |
| 238 | <p>By setting this attribute to a process name that's shared with another |
| 239 | application, you can arrange for components of both applications to run in |
| 240 | the same process — but only if the two applications also share a |
| 241 | user ID and be signed with the same certificate. |
| 242 | </p> |
| 243 | |
| 244 | <p> |
| 245 | If the name assigned to this attribute begins with a colon (':'), a new |
| 246 | process, private to the application, is created when it's needed. |
| 247 | If the process name begins with a lowercase character, a global process |
| 248 | of that name is created. A global process can be shared with other |
| 249 | applications, reducing resource usage. |
| 250 | </p></dd> |
| 251 | |
| Christopher Tate | 4e14a82 | 2010-04-08 12:54:23 -0700 | [diff] [blame] | 252 | <dt><a href name="restoreany"></a>{@code android:restoreAnyVersion}</dt> |
| 253 | <dd>Indicate that the application is prepared to attempt a restore of any |
| 254 | backed-up data set, even if the backup was stored by a newer version |
| 255 | of the application than is currently installed on the device. Setting |
| 256 | this attribute to {@code true} will permit the Backup Manager to |
| 257 | attempt restore even when a version mismatch suggests that the data are |
| 258 | incompatible. <em>Use with caution!</em> |
| 259 | |
| 260 | <p>The default value of this attribute is {@code false}. |
| 261 | </p></dd> |
| 262 | |
| The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 263 | <dt><a href name="aff"></a>{@code android:taskAffinity}</dt> |
| 264 | <dd>An affinity name that applies to all activities within the application, |
| 265 | except for those that set a different affinity with their own |
| 266 | <code><a href="{@docRoot}guide/topics/manifest/activity-element.html#aff">taskAffinity</a></code> |
| 267 | attributes. See that attribute for more information. |
| 268 | |
| 269 | <p> |
| 270 | By default, all activities within an application share the same |
| 271 | affinity. The name of that affinity is the same as the package name |
| 272 | set by the |
| 273 | <code><a href="{@docRoot}guide/topics/manifest/manifest-element.html"><manifest></a></code> element. |
| 274 | </p></dd> |
| 275 | |
| 276 | <dt><a name="theme"></a>{@code android:theme}</dt> |
| 277 | <dd>A reference to a style resource defining a default theme for all |
| 278 | activities in the application. Individual activities can override |
| 279 | the default by setting their own <code><a href="{@docRoot}guide/topics/manifest/activity-element.html#theme">theme</a></code> |
| Scott Main | 084369f | 2011-10-20 20:12:21 -0700 | [diff] [blame^] | 280 | attributes. For more information, see the <a |
| 281 | href="{@docRoot}guide/topics/ui/themes.html">Styles and Themes</a> developer guide. |
| 282 | </dd> |
| 283 | |
| 284 | <!-- ##api level 14## --> |
| 285 | <dt><a name="uioptions"></a>{@code android:uiOptions}</dt> |
| 286 | <dd>Extra options for an activity's UI. |
| 287 | <p>Must be one of the following values.</p> |
| 288 | |
| 289 | <table> |
| 290 | <tr><th>Value</th><th>Description</th></tr> |
| 291 | <tr><td>{@code "none"}</td><td>No extra UI options. This is the default.</td></tr> |
| 292 | <tr><td>{@code "splitActionBarWhenNarrow"}</td><td>Add a bar at |
| 293 | the bottom of the screen to display action items in the {@link android.app.ActionBar}, when |
| 294 | constrained for horizontal space (such as when in portrait mode on a handset). Instead of a small |
| 295 | number of action items appearing in the action bar at the top of the screen, the action bar is |
| 296 | split into the top navigation section and the bottom bar for action items. This ensures a reasonable |
| 297 | amount of space is made available not only for the action items, but also for navigation and title |
| 298 | elements at the top. Menu items are not split across the two bars; they always appear |
| 299 | together.</td></tr> |
| 300 | </table> |
| 301 | <p>For more information about the action bar, see the <a |
| 302 | href="{@docRoot}guide/topics/ui/actionbar.html">Action Bar</a> developer guide.</p> |
| 303 | <p>This attribute was added in API level 14.</p> |
| 304 | </dd> |
| The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 305 | |
| 306 | </dl></dd> |
| 307 | |
| Dirk Dougherty | 9c3209d | 2009-04-18 22:01:18 -0700 | [diff] [blame] | 308 | <!-- ##api level indication## --> |
| 309 | <dt>introduced in:</dt> |
| 310 | <dd>API Level 1</dd> |
| 311 | |
| The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 312 | <dt>see also:</dt> |
| 313 | <dd><code><a href="{@docRoot}guide/topics/manifest/activity-element.html"><activity></a></code> |
| 314 | <br/><code><a href="{@docRoot}guide/topics/manifest/service-element.html"><service></a></code> |
| 315 | <br/><code><a href="{@docRoot}guide/topics/manifest/receiver-element.html"><receiver></a></code> |
| 316 | <br/><code><a href="{@docRoot}guide/topics/manifest/provider-element.html"><provider></a></code></dd> |
| 317 | |
| 318 | </dl> |