am 138836ad: Merge "docs: add info about manifest attributes that should not change" into honeycomb-mr2
* commit '138836adc7e28e66984fdc20d22688d4da561c15': docs: add info about manifest attributes that should not change
This commit is contained in:
@@ -145,7 +145,7 @@ href="{@docRoot}guide/topics/ui/index.html">User Interface</a> documentation.</p
|
|||||||
<h3 id="Declaring">Declaring the activity in the manifest</h3>
|
<h3 id="Declaring">Declaring the activity in the manifest</h3>
|
||||||
|
|
||||||
<p>You must declare your activity in the manifest file in order for it to
|
<p>You must declare your activity in the manifest file in order for it to
|
||||||
be accessible to the system. To decalare your activity, open your manifest file and add an <a
|
be accessible to the system. To declare your activity, open your manifest file and add an <a
|
||||||
href="{@docRoot}guide/topics/manifest/activity-element.html">{@code <activity>}</a> element
|
href="{@docRoot}guide/topics/manifest/activity-element.html">{@code <activity>}</a> element
|
||||||
as a child of the <a
|
as a child of the <a
|
||||||
href="{@docRoot}guide/topics/manifest/application-element.html">{@code <application>}</a>
|
href="{@docRoot}guide/topics/manifest/application-element.html">{@code <application>}</a>
|
||||||
@@ -163,9 +163,16 @@ element. For example:</p>
|
|||||||
|
|
||||||
<p>There are several other attributes that you can include in this element, to define properties
|
<p>There are several other attributes that you can include in this element, to define properties
|
||||||
such as the label for the activity, an icon for the activity, or a theme to style the activity's
|
such as the label for the activity, an icon for the activity, or a theme to style the activity's
|
||||||
UI. See the <a
|
UI. The <a href="{@docRoot}guide/topics/manifest/activity-element.html#nm">{@code android:name}</a>
|
||||||
|
attribute is the only required attribute—it specifies the class name of the activity. Once
|
||||||
|
you publish your application, you should not change this name, because if you do, you might break
|
||||||
|
some functionality, such as application shortcuts (read the blog post, <a
|
||||||
|
href="http://android-developers.blogspot.com/2011/06/things-that-cannot-change.html">Things
|
||||||
|
That Cannot Change</a>).</p>
|
||||||
|
|
||||||
|
<p>See the <a
|
||||||
href="{@docRoot}guide/topics/manifest/activity-element.html">{@code <activity>}</a> element
|
href="{@docRoot}guide/topics/manifest/activity-element.html">{@code <activity>}</a> element
|
||||||
reference for more information about available attributes.</p>
|
reference for more information about declaring your activity in the manifest.</p>
|
||||||
|
|
||||||
|
|
||||||
<h4>Using intent filters</h4>
|
<h4>Using intent filters</h4>
|
||||||
|
|||||||
@@ -203,7 +203,7 @@ it from other application components.</p>
|
|||||||
<p>Like activities (and other components), you must declare all services in your application's
|
<p>Like activities (and other components), you must declare all services in your application's
|
||||||
manifest file.</p>
|
manifest file.</p>
|
||||||
|
|
||||||
<p>To decalare your service, add a <a
|
<p>To declare your service, add a <a
|
||||||
href="{@docRoot}guide/topics/manifest/service-element.html">{@code <service>}</a> element
|
href="{@docRoot}guide/topics/manifest/service-element.html">{@code <service>}</a> element
|
||||||
as a child of the <a
|
as a child of the <a
|
||||||
href="{@docRoot}guide/topics/manifest/application-element.html">{@code <application>}</a>
|
href="{@docRoot}guide/topics/manifest/application-element.html">{@code <application>}</a>
|
||||||
@@ -222,9 +222,17 @@ element. For example:</p>
|
|||||||
<p>There are other attributes you can include in the <a
|
<p>There are other attributes you can include in the <a
|
||||||
href="{@docRoot}guide/topics/manifest/service-element.html">{@code <service>}</a> element to
|
href="{@docRoot}guide/topics/manifest/service-element.html">{@code <service>}</a> element to
|
||||||
define properties such as permissions required to start the service and the process in
|
define properties such as permissions required to start the service and the process in
|
||||||
which the service should run. See the <a
|
which the service should run. The <a
|
||||||
|
href="{@docRoot}guide/topics/manifest/service-element.html#nm">{@code android:name}</a>
|
||||||
|
attribute is the only required attribute—it specifies the class name of the service. Once
|
||||||
|
you publish your application, you should not change this name, because if you do, you might break
|
||||||
|
some functionality where explicit intents are used to reference your service (read the blog post, <a
|
||||||
|
href="http://android-developers.blogspot.com/2011/06/things-that-cannot-change.html">Things
|
||||||
|
That Cannot Change</a>).
|
||||||
|
|
||||||
|
<p>See the <a
|
||||||
href="{@docRoot}guide/topics/manifest/service-element.html">{@code <service>}</a> element
|
href="{@docRoot}guide/topics/manifest/service-element.html">{@code <service>}</a> element
|
||||||
reference for more information.</p>
|
reference for more information about declaring your service in the manifest.</p>
|
||||||
|
|
||||||
<p>Just like an activity, a service can define intent filters that allow other components to
|
<p>Just like an activity, a service can define intent filters that allow other components to
|
||||||
invoke the service using implicit intents. By declaring intent filters, components
|
invoke the service using implicit intents. By declaring intent filters, components
|
||||||
|
|||||||
@@ -507,6 +507,10 @@ However, as a shorthand, if the first character of the name is a period
|
|||||||
package name specified in the
|
package name specified in the
|
||||||
<code><a href="{@docRoot}guide/topics/manifest/manifest-element.html"><manifest></a></code>
|
<code><a href="{@docRoot}guide/topics/manifest/manifest-element.html"><manifest></a></code>
|
||||||
element.
|
element.
|
||||||
|
<p>Once you publish your application, you <a
|
||||||
|
href="http://android-developers.blogspot.com/2011/06/things-that-cannot-change.html">should not
|
||||||
|
change this name</a> (unless you've set <code><a
|
||||||
|
href="#exported">android:exported</a>="false"</code>).</p>
|
||||||
|
|
||||||
<p>
|
<p>
|
||||||
There is no default. The name must be specified.
|
There is no default. The name must be specified.
|
||||||
|
|||||||
@@ -47,12 +47,15 @@ and specify {@code xlmns:android} and {@code package} attributes.</dd>
|
|||||||
to "{@code http://schemas.android.com/apk/res/android}".</dd>
|
to "{@code http://schemas.android.com/apk/res/android}".</dd>
|
||||||
|
|
||||||
<dt><a name="package"></a>{@code package}</dt>
|
<dt><a name="package"></a>{@code package}</dt>
|
||||||
<dd>A full Java package name for the application. The name should
|
<dd>A full Java-language-style package name for the application. The name should
|
||||||
be unique. The name may contain uppercase or lowercase letters ('A'
|
be unique. The name may contain uppercase or lowercase letters ('A'
|
||||||
through 'Z'), numbers, and underscores ('_'). However, individual
|
through 'Z'), numbers, and underscores ('_'). However, individual
|
||||||
package name parts may only start with letters. For example, applications
|
package name parts may only start with letters.
|
||||||
published by Google could have names in the form
|
|
||||||
<code>com.google.app.<i>application_name</i></code>.
|
<p>To avoid conflicts with other developers, you should use Internet domain ownership as the
|
||||||
|
basis for your package names (in reverse). For example, applications published by Google start with
|
||||||
|
<code>com.google</code>. You should also never use the <code>com.example</code> namespace when
|
||||||
|
publishing your applications.</p>
|
||||||
|
|
||||||
<p>
|
<p>
|
||||||
The package name serves as a unique identifier for the application.
|
The package name serves as a unique identifier for the application.
|
||||||
@@ -66,6 +69,12 @@ published by Google could have names in the form
|
|||||||
element's
|
element's
|
||||||
<code><a href="{@docRoot}guide/topics/manifest/activity-element.html#aff">taskAffinity</a></code> attribute).
|
<code><a href="{@docRoot}guide/topics/manifest/activity-element.html#aff">taskAffinity</a></code> attribute).
|
||||||
</p>
|
</p>
|
||||||
|
|
||||||
|
<p class="caution"><strong>Caution:</strong> Once you publish your application, you
|
||||||
|
<strong>cannot change the package name</strong>. The package name defines your application's
|
||||||
|
identity, so if you change it, then it is considered to be a different application and users of
|
||||||
|
the previous version cannot update to the new version.</p>
|
||||||
|
|
||||||
</dd>
|
</dd>
|
||||||
|
|
||||||
<dt><a name="uid"></a>{@code android:sharedUserId}</dt>
|
<dt><a name="uid"></a>{@code android:sharedUserId}</dt>
|
||||||
|
|||||||
@@ -122,6 +122,11 @@ as a shorthand, if the first character of the name is a period (for example,
|
|||||||
"{@code . ReportReceiver}"), it is appended to the package name specified in
|
"{@code . ReportReceiver}"), it is appended to the package name specified in
|
||||||
the <code><a href="{@docRoot}guide/topics/manifest/manifest-element.html"><manifest></a></code> element.
|
the <code><a href="{@docRoot}guide/topics/manifest/manifest-element.html"><manifest></a></code> element.
|
||||||
|
|
||||||
|
<p>Once you publish your application, you <a
|
||||||
|
href="http://android-developers.blogspot.com/2011/06/things-that-cannot-change.html">should not
|
||||||
|
change this name</a> (unless you've set <code><a
|
||||||
|
href="#exported">android:exported</a>="false"</code>).</p>
|
||||||
|
|
||||||
<p>
|
<p>
|
||||||
There is no default. The name must be specified.
|
There is no default. The name must be specified.
|
||||||
</p></dd>
|
</p></dd>
|
||||||
|
|||||||
@@ -6,7 +6,7 @@ parent.link=manifest-intro.html
|
|||||||
<dl class="xml">
|
<dl class="xml">
|
||||||
<dt>syntax:</dt>
|
<dt>syntax:</dt>
|
||||||
<dd><pre class="stx"><service android:<a href="#enabled">enabled</a>=["true" | "false"]
|
<dd><pre class="stx"><service android:<a href="#enabled">enabled</a>=["true" | "false"]
|
||||||
android:<a href="#exported">exported[</a>="true" | "false"]
|
android:<a href="#exported">exported</a>=["true" | "false"]
|
||||||
android:<a href="#icon">icon</a>="<i>drawable resource</i>"
|
android:<a href="#icon">icon</a>="<i>drawable resource</i>"
|
||||||
android:<a href="#label">label</a>="<i>string resource</i>"
|
android:<a href="#label">label</a>="<i>string resource</i>"
|
||||||
android:<a href="#nm">name</a>="<i>string</i>"
|
android:<a href="#nm">name</a>="<i>string</i>"
|
||||||
@@ -121,6 +121,11 @@ the first character of the name is a period (for example, "{@code .RoomService}"
|
|||||||
it is appended to the package name specified in the
|
it is appended to the package name specified in the
|
||||||
<code><a href="{@docRoot}guide/topics/manifest/manifest-element.html"><manifest></a></code> element.
|
<code><a href="{@docRoot}guide/topics/manifest/manifest-element.html"><manifest></a></code> element.
|
||||||
|
|
||||||
|
<p>Once you publish your application, you <a
|
||||||
|
href="http://android-developers.blogspot.com/2011/06/things-that-cannot-change.html">should not
|
||||||
|
change this name</a> (unless you've set <code><a
|
||||||
|
href="#exported">android:exported</a>="false"</code>).</p>
|
||||||
|
|
||||||
<p>
|
<p>
|
||||||
There is no default. The name must be specified.
|
There is no default. The name must be specified.
|
||||||
</p></dd>
|
</p></dd>
|
||||||
|
|||||||
Reference in New Issue
Block a user