1 page.title=<application> 2 3 @jd:body 4 5 <dl class="xml"> 6 <dt>syntax:</dt> 7 <dd><pre class="stx"><application android:<a href="#reparent">allowTaskReparenting</a>=["true" | "false"] 8 android:<a href="#allowbackup">allowBackup</a>=["true" | "false"] 9 android:<a href="#agent">backupAgent</a>="<i>string</i>" 10 android:<a href="#banner">banner</a>="<i>drawable resource</i>" 11 android:<a href="#debug">debuggable</a>=["true" | "false"] 12 android:<a href="#desc">description</a>="<i>string resource</i>" 13 android:<a href="#enabled">enabled</a>=["true" | "false"] 14 android:<a href="#code">hasCode</a>=["true" | "false"] 15 android:<a href="#hwaccel">hardwareAccelerated</a>=["true" | "false"] 16 android:<a href="#icon">icon</a>="<i>drawable resource</i>" 17 android:<a href="#isGame">isGame</a>=["true" | "false"] 18 android:<a href="#killrst">killAfterRestore</a>=["true" | "false"] 19 android:<a href="#largeHeap">largeHeap</a>=["true" | "false"] 20 android:<a href="#label">label</a>="<i>string resource</i>" 21 android:<a href="#logo">logo</a>="<i>drawable resource</i>" 22 android:<a href="#space">manageSpaceActivity</a>="<i>string</i>" 23 android:<a href="#nm">name</a>="<i>string</i>" 24 android:<a href="#prmsn">permission</a>="<i>string</i>" 25 android:<a href="#persistent">persistent</a>=["true" | "false"] 26 android:<a href="#proc">process</a>="<i>string</i>" 27 android:<a href="#restoreany">restoreAnyVersion</a>=["true" | "false"] 28 android:<a href="#requiredAccountType">requiredAccountType</a>="<i>string</i>" 29 android:<a href="#restrictedAccountType">restrictedAccountType</a>="<i>string</i>" 30 android:<a href="#supportsrtl">supportsRtl</a>=["true" | "false"] 31 android:<a href="#aff">taskAffinity</a>="<i>string</i>" 32 android:<a href="#testOnly">testOnly</a>=["true" | "false"] 33 android:<a href="#theme">theme</a>="<i>resource or theme</i>" 34 android:<a href="#uioptions">uiOptions</a>=["none" | "splitActionBarWhenNarrow"] 35 android:<a href="#vmSafeMode">vmSafeMode</a>=["true" | "false"] > 36 . . . 37 </application></pre></dd> 38 39 <dt>contained in:</dt> 40 <dd><code><a href="{@docRoot}guide/topics/manifest/manifest-element.html"><manifest></a></code></dd> 41 42 <dt>can contain:</dt> 43 <dd><code><a href="{@docRoot}guide/topics/manifest/activity-element.html"><activity></a></code> 44 <br/><code><a href="{@docRoot}guide/topics/manifest/activity-alias-element.html"><activity-alias></a></code> 45 <br/><code><a href="{@docRoot}guide/topics/manifest/meta-data-element.html"><meta-data></a></code> 46 <br/><code><a href="{@docRoot}guide/topics/manifest/service-element.html"><service></a></code> 47 <br/><code><a href="{@docRoot}guide/topics/manifest/receiver-element.html"><receiver></a></code> 48 <br/><code><a href="{@docRoot}guide/topics/manifest/provider-element.html"><provider></a></code> 49 <br/><code><a href="{@docRoot}guide/topics/manifest/uses-library-element.html"><uses-library></a></code></dd> 50 51 <dt>description:</dt> 52 <dd itemprop="description">The declaration of the application. This element contains subelements 53 that declare each of the application's components and has attributes 54 that can affect all the components. Many of these attributes (such as 55 {@code icon}, {@code label}, {@code permission}, {@code process}, 56 {@code taskAffinity}, and {@code allowTaskReparenting}) set default values 57 for corresponding attributes of the component elements. Others (such as 58 {@code debuggable}, {@code enabled}, {@code description}, and 59 {@code allowClearUserData}) set values for the application as a whole and 60 cannot be overridden by the components.</dd> 61 62 63 64 65 66 <dt>attributes</dt> 67 <dd><dl class="attr"> 68 69 <dt><a name="reparent"></a>{@code android:allowTaskReparenting}</dt> 70 <dd>Whether or not activities that the application defines can move from 71 the task that started them to the task they have an affinity for when that task 72 is next brought to the front — {@code "true"} if they can move, and 73 {@code "false"} if they must remain with the task where they started. 74 The default value is {@code "false"}. 75 76 <p> 77 The 78 <code><a href="{@docRoot}guide/topics/manifest/activity-element.html"><activity></a></code> 79 element has its own 80 <code><a href="{@docRoot}guide/topics/manifest/activity-element.html#reparent">allowTaskReparenting</a></code> 81 attribute that can override the value set here. See that attribute for more 82 information. 83 </p></dd> 84 85 86 <dt><a name="allowbackup"></a>{@code android:allowBackup}</dt> 87 <dd>Whether to allow the application to participate in the backup 88 and restore infrastructure. If this attribute is set to false, no backup 89 or restore of the application will ever be performed, even by a full-system 90 backup that would otherwise cause all application data to be saved via adb. 91 The default value of this attribute is true.</dd> 92 93 94 <dt><a name="agent"></a>{@code android:backupAgent}</dt> 95 <dd>The name of the class that implement's the application's backup agent, 96 a subclass of {@link android.app.backup.BackupAgent}. The attribute value should be 97 a fully qualified class name (such as, {@code "com.example.project.MyBackupAgent"}). 98 However, as a shorthand, if the first character of the name is a period 99 (for example, {@code ".MyBackupAgent"}), it is appended to the 100 package name specified in the 101 <code><a href="{@docRoot}guide/topics/manifest/manifest-element.html"><manifest></a></code> 102 element. 103 104 <p> 105 There is no default. The name must be specified. 106 </p></dd> 107 108 <dt><a name="banner"></a>{@code android:banner}</dt> 109 <dd>A <a href="{@docRoot}guide/topics/resources/drawable-resource.html">drawable resource</a> 110 providing an extended graphical banner for its associated item. Use with the 111 {@code <application>} tag to supply a default banner for all application activities, or with the 112 <a href="{@docRoot}guide/topics/manifest/activity-element.html"><code><activity></code></a> 113 tag to supply a banner for a specific activity. 114 115 <p>The system uses the banner to represent an app in 116 the Android TV home screen. Since the banner is displayed only in the home screen, it 117 should only be specified by applications with an activity that handles the 118 {@link android.content.Intent#CATEGORY_LEANBACK_LAUNCHER} intent.</p> 119 120 <p>This attribute must be set as a reference to a drawable resource containing 121 the image (for example {@code "@drawable/banner"}). There is no default banner. 122 </p> 123 124 <p> 125 See <a href="{@docRoot}design/tv/patterns.html#banner"> 126 Banners</a> in the UI Patterns for TV design guide, and <a href="{@docRoot}training/tv/start/start.html#banner"> 127 Provide a home screen banner</a> in Get Started with TV Apps for more information. 128 </p></dd> 129 130 <dt><a name="debug"></a>{@code android:debuggable}</dt> 131 <dd>Whether or not the application can be debugged, even when running 132 on a device in user mode — {@code "true"} if it can be, and {@code "false"} 133 if not. The default value is {@code "false"}.</dd> 134 135 <dt><a name="desc"></a>{@code android:description}</dt> 136 <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> 137 138 <dt><a name="enabled"></a>{@code android:enabled}</dt> 139 <dd>Whether or not the Android system can instantiate components of 140 the application — {@code "true"} if it can, and {@code "false"} 141 if not. If the value is {@code "true"}, each component's 142 {@code enabled} attribute determines whether that component is enabled 143 or not. If the value is {@code "false"}, it overrides the 144 component-specific values; all components are disabled. 145 146 <p> 147 The default value is {@code "true"}. 148 </p></dd> 149 150 <dt><a name="code"></a>{@code android:hasCode}</dt> 151 <dd>Whether or not the application contains any code — {@code "true"} 152 if it does, and {@code "false"} if not. When the value is {@code "false"}, 153 the system does not try to load any application code when launching components. 154 The default value is {@code "true"}. 155 156 <p> 157 An application would not have any code of its own only if it's using nothing 158 but built-in component classes, such as an activity that uses the {@link 159 android.app.AliasActivity} class, a rare occurrence.</p> 160 </dd> 161 162 <dt><a name="hwaccel"></a>{@code android:hardwareAccelerated}</dt> 163 <dd>Whether or not hardware-accelerated rendering should be enabled for all 164 activities and views in this application — {@code "true"} if it 165 should be enabled, and {@code "false"} if not. The default value is {@code "true"} if you've set 166 either <a href="{@docRoot}guide/topics/manifest/uses-sdk-element.html#min">{@code minSdkVersion}</a> 167 or <a 168 href="{@docRoot}guide/topics/manifest/uses-sdk-element.html#target">{@code targetSdkVersion}</a> 169 to {@code "14"} or higher; otherwise, it's {@code "false"}. 170 171 <p>Starting from Android 3.0 (API level 11), a hardware-accelerated OpenGL renderer is 172 available to applications, to improve performance for many common 2D graphics 173 operations. When the hardware-accelerated renderer is enabled, most operations 174 in Canvas, Paint, Xfermode, ColorFilter, Shader, and Camera are accelerated. 175 This results in smoother animations, smoother scrolling, and improved 176 responsiveness overall, even for applications that do not explicitly make use 177 the framework's OpenGL libraries. </p> 178 179 <p>Note that not all of the OpenGL 2D operations are accelerated. If you enable 180 the hardware-accelerated renderer, test your application to ensure that it can 181 make use of the renderer without errors.</p> 182 183 <p>For more information, read the <a href="{@docRoot}guide/topics/graphics/hardware-accel.html" 184 >Hardware Acceleration</a> guide.</p> 185 </dd> 186 187 <dt><a name="icon"></a>{@code android:icon}</dt> 188 <dd>An icon for the application as whole, and the default icon for 189 each of the application's components. See the individual 190 {@code icon} attributes for 191 <code><a href="{@docRoot}guide/topics/manifest/activity-element.html"><activity></a></code>, 192 <code><a href="{@docRoot}guide/topics/manifest/activity-alias-element.html"><activity-alias></a></code>, 193 <code><a href="{@docRoot}guide/topics/manifest/service-element.html"><service></a></code>, 194 <code><a href="{@docRoot}guide/topics/manifest/receiver-element.html"><receiver></a></code>, and 195 <code><a href="{@docRoot}guide/topics/manifest/provider-element.html"><provider></a></code> elements. 196 197 <p> 198 This attribute must be set as a reference to a drawable resource containing 199 the image (for example {@code "@drawable/icon"}). There is no default icon. 200 </p></dd> 201 202 <dt><a name="isGame"></a>{@code android:isGame}</dt> 203 <dd>Whether or not the application is a game. The system may group together applications classifed 204 as games or display them separately from other applications. 205 206 <p>The default is {@code false}.</p></dd> 207 208 <dt><a name="killrst"></a>{@code android:killAfterRestore}</dt> 209 <dd>Whether the application in question should be terminated after its 210 settings have been restored during a full-system restore operation. 211 Single-package restore operations will never cause the application to 212 be shut down. Full-system restore operations typically only occur once, 213 when the phone is first set up. Third-party applications will not normally 214 need to use this attribute. 215 216 <p>The default is {@code true}, which means that after the application 217 has finished processing its data during a full-system restore, it will be 218 terminated. 219 </p></dd> 220 221 <dt><a name="largeHeap"></a>{@code android:largeHeap}</dt> 222 <dd>Whether your application's processes should be created with a large Dalvik heap. This applies to 223 all processes created for the application. It only applies to the first application loaded into a 224 process; if you're using a shared user ID to allow multiple applications to use a process, they all 225 must use this option consistently or they will have unpredictable results. 226 <p>Most apps should not need this and should instead focus on reducing their overall memory usage for 227 improved performance. Enabling this also does not guarantee a fixed increase in available memory, 228 because some devices are constrained by their total available memory.</p> 229 <p>To query the available memory size at runtime, use the methods {@link 230 android.app.ActivityManager#getMemoryClass()} or {@link 231 android.app.ActivityManager#getLargeMemoryClass()}.</p> 232 </dd> 233 234 <dt><a name="label"></a>{@code android:label}</dt> 235 <dd>A user-readable label for the application as a whole, and a default 236 label for each of the application's components. See the individual 237 {@code label} attributes for 238 <code><a href="{@docRoot}guide/topics/manifest/activity-element.html"><activity></a></code>, 239 <code><a href="{@docRoot}guide/topics/manifest/activity-alias-element.html"><activity-alias></a></code>, 240 <code><a href="{@docRoot}guide/topics/manifest/service-element.html"><service></a></code>, 241 <code><a href="{@docRoot}guide/topics/manifest/receiver-element.html"><receiver></a></code>, and 242 <code><a href="{@docRoot}guide/topics/manifest/provider-element.html"><provider></a></code> elements. 243 244 <p> 245 The label should be set as a reference to a string resource, so that 246 it can be localized like other strings in the user interface. 247 However, as a convenience while you're developing the application, 248 it can also be set as a raw string. 249 </p></dd> 250 251 <dt><a name="logo"></a>{@code android:logo}</dt> 252 <dd>A logo for the application as whole, and the default logo for activities. 253 <p>This attribute must be set as a reference to a drawable resource containing 254 the image (for example {@code "@drawable/logo"}). There is no default logo.</p></dd> 255 256 <dt><a name="space"></a>{@code android:manageSpaceActivity}</dt> 257 <dd>The fully qualified name of an Activity subclass that the system 258 can launch to let users manage the memory occupied by the application 259 on the device. The activity should also be declared with an 260 <code><a href="{@docRoot}guide/topics/manifest/activity-element.html"><activity></a></code> element. 261 </dd> 262 263 <dt><a name="nm"></a>{@code android:name}</dt> 264 <dd>The fully qualified name of an {@link android.app.Application} 265 subclass implemented for the application. When the application process 266 is started, this class is instantiated before any of the application's 267 components. 268 269 <p> 270 The subclass is optional; most applications won't need one. 271 In the absence of a subclass, Android uses an instance of the base 272 Application class. 273 </p></dd> 274 275 <dt><a name="prmsn"></a>{@code android:permission}</dt> 276 <dd>The name of a permission that clients must have in order to interact 277 with the application. This attribute is a convenient way to set a 278 permission that applies to all of the application's components. It can 279 be overwritten by setting the {@code permission} attributes of individual 280 components. 281 282 <p> 283 For more information on permissions, see the 284 <a href="{@docRoot}guide/topics/manifest/manifest-intro.html#sectperm">Permissions</a> 285 section in the introduction and another document, 286 <a href="{@docRoot}guide/topics/security/security.html">Security and 287 Permissions</a>. 288 </p></dd> 289 290 <dt><a name="persistent"></a>{@code android:persistent}</dt> 291 <dd>Whether or not the application should remain running at all times — 292 {@code "true"} if it should, and {@code "false"} if not. The default value 293 is {@code "false"}. Applications should not normally set this flag; 294 persistence mode is intended only for certain system applications.</dd> 295 296 <dt><a name="proc"></a>{@code android:process}</dt> 297 <dd>The name of a process where all components of the application should run. 298 Each component can override this default by setting its own {@code process} 299 attribute. 300 301 <p> 302 By default, Android creates a process for an application when the first 303 of its components needs to run. All components then run in that process. 304 The name of the default process matches the package name set by the 305 <code><a href="{@docRoot}guide/topics/manifest/manifest-element.html"><manifest></a></code> element. 306 </p> 307 308 <p>By setting this attribute to a process name that's shared with another 309 application, you can arrange for components of both applications to run in 310 the same process — but only if the two applications also share a 311 user ID and be signed with the same certificate. 312 </p> 313 314 <p> 315 If the name assigned to this attribute begins with a colon (':'), a new 316 process, private to the application, is created when it's needed. 317 If the process name begins with a lowercase character, a global process 318 of that name is created. A global process can be shared with other 319 applications, reducing resource usage. 320 </p></dd> 321 322 <dt><a name="restoreany"></a>{@code android:restoreAnyVersion}</dt> 323 <dd>Indicates that the application is prepared to attempt a restore of any 324 backed-up data set, even if the backup was stored by a newer version 325 of the application than is currently installed on the device. Setting 326 this attribute to {@code true} will permit the Backup Manager to 327 attempt restore even when a version mismatch suggests that the data are 328 incompatible. <em>Use with caution!</em> 329 330 <p>The default value of this attribute is {@code false}. 331 </p></dd> 332 333 334 335 <dt><a name="requiredAccountType"></a>{@code android:requiredAccountType}</dt> 336 <dd>Specifies the account type required by the application in order to function. 337 If your app requires an {@link android.accounts.Account}, the value for this attribute must 338 correspond to the account authenticator 339 type used by your app (as defined by {@link android.accounts.AuthenticatorDescription}), 340 such as "com.google". 341 342 <p>The default value is null and indicates that the application 343 can work <em>without</em> any accounts. 344 345 <p>Because restricted profiles currently 346 cannot add accounts, specifying this attribute <strong>makes your app 347 unavailable from a restricted profile</strong> unless you also declare 348 <a href="#restrictedAccountType">{@code android:restrictedAccountType}</a> with 349 the same value.</p> 350 351 <p class="caution"><strong>Caution:</strong> 352 If the account data may reveal personally identifiable information, it's important 353 that you declare this attribute and leave <a href="#restrictedAccountType">{@code android:restrictedAccountType}</a> null, so that restricted profiles cannot use 354 your app to access personal information that belongs to the owner user.</p> 355 356 <p>This attribute was added in API level 18.</p> 357 </dd> 358 359 360 <dt><a name="restrictedAccountType"></a>{@code android:restrictedAccountType}</dt> 361 <dd>Specifies the account type required by this application and indicates that restricted profiles 362 are allowed to access such accounts that belong to the owner user. If your app requires an 363 {@link android.accounts.Account} and restricted profiles <strong>are allowed to 364 access</strong> the primary user's accounts, the value for this attribute must 365 correspond to the account authenticator type used by your app (as 366 defined by {@link android.accounts.AuthenticatorDescription}), such as "com.google". 367 368 <p>The default value is null and indicates that the application can work <em>without</em> any 369 accounts. 370 371 <p class="caution"><strong>Caution:</strong> 372 Specifying this attribute allows restricted profiles to use your 373 app with accounts that belong to the owner user, which may reveal personally identifiable 374 information. If the account may reveal personal details, you <strong>should not</strong> 375 use this attribute and you should instead declare the <a 376 href="#requiredAccountType">{@code android:requiredAccountType}</a> attribute 377 to make your app unavailable to restricted profiles.</p> 378 379 <p>This attribute was added in API level 18.</p> 380 </dd> 381 382 383 384 <dt><a name="supportsrtl"></a>{@code android:supportsRtl}</dt> 385 <dd>Declares whether your application is willing to support right-to-left (RTL) layouts. 386 <p>If set to {@code true} and <a href="{@docRoot}guide/topics/manifest/uses-sdk-element.html#target" 387 >{@code targetSdkVersion}</a> is set to 17 or higher, various RTL APIs will be 388 activated and used by the system so your app can display RTL layouts. 389 If set to {@code false} or if <a href="{@docRoot}guide/topics/manifest/uses-sdk-element.html#target" 390 >{@code targetSdkVersion}</a> is set to 16 or lower, the RTL APIs will be ignored 391 or will have no effect and your app will behave the same regardless of the layout 392 direction associated to the user's Locale choice (your layouts will always be left-to-right). 393 394 <p>The default value of this attribute is {@code false}.</p> 395 396 <p>This attribute was added in API level 17.</p> 397 </dd> 398 399 <dt><a name="aff"></a>{@code android:taskAffinity}</dt> 400 <dd>An affinity name that applies to all activities within the application, 401 except for those that set a different affinity with their own 402 <code><a href="{@docRoot}guide/topics/manifest/activity-element.html#aff">taskAffinity</a></code> 403 attributes. See that attribute for more information. 404 405 <p> 406 By default, all activities within an application share the same 407 affinity. The name of that affinity is the same as the package name 408 set by the 409 <code><a href="{@docRoot}guide/topics/manifest/manifest-element.html"><manifest></a></code> element. 410 </p></dd> 411 412 <dt><a name="testOnly"></a>{@code android:testOnly}</dt> 413 <dd>Indicates whether this application is only for testing purposes. For example, 414 it may expose functionality or data outside of itself that would cause a security 415 hole, but is useful for testing. This kind of application can be installed 416 only through adb.</dd> 417 418 419 <dt><a name="theme"></a>{@code android:theme}</dt> 420 <dd>A reference to a style resource defining a default theme for all 421 activities in the application. Individual activities can override 422 the default by setting their own <code><a href="{@docRoot}guide/topics/manifest/activity-element.html#theme">theme</a></code> 423 attributes. For more information, see the <a 424 href="{@docRoot}guide/topics/ui/themes.html">Styles and Themes</a> developer guide. 425 </dd> 426 427 <!-- ##api level 14## --> 428 <dt><a name="uioptions"></a>{@code android:uiOptions}</dt> 429 <dd>Extra options for an activity's UI. 430 <p>Must be one of the following values.</p> 431 432 <table> 433 <tr><th>Value</th><th>Description</th></tr> 434 <tr><td>{@code "none"}</td><td>No extra UI options. This is the default.</td></tr> 435 <tr><td>{@code "splitActionBarWhenNarrow"}</td><td>Add a bar at 436 the bottom of the screen to display action items in the {@link android.app.ActionBar}, when 437 constrained for horizontal space (such as when in portrait mode on a handset). Instead of a small 438 number of action items appearing in the action bar at the top of the screen, the action bar is 439 split into the top navigation section and the bottom bar for action items. This ensures a reasonable 440 amount of space is made available not only for the action items, but also for navigation and title 441 elements at the top. Menu items are not split across the two bars; they always appear 442 together.</td></tr> 443 </table> 444 <p>For more information about the action bar, see the <a 445 href="{@docRoot}guide/topics/ui/actionbar.html">Action Bar</a> developer guide.</p> 446 <p>This attribute was added in API level 14.</p> 447 </dd> 448 449 <dt><a name="vmSafeMode"></a>{@code android:vmSafeMode}</dt> 450 <dd>Indicates whether the app would like the virtual machine (VM) to operate 451 in safe mode. The default value is {@code "false"}. 452 </dd> 453 454 455 456 457 </dl></dd> 458 459 <!-- ##api level indication## --> 460 <dt>introduced in:</dt> 461 <dd>API Level 1</dd> 462 463 <dt>see also:</dt> 464 <dd><code><a href="{@docRoot}guide/topics/manifest/activity-element.html"><activity></a></code> 465 <br/><code><a href="{@docRoot}guide/topics/manifest/service-element.html"><service></a></code> 466 <br/><code><a href="{@docRoot}guide/topics/manifest/receiver-element.html"><receiver></a></code> 467 <br/><code><a href="{@docRoot}guide/topics/manifest/provider-element.html"><provider></a></code></dd> 468 469 </dl> 470