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