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