Merge change 21149 into donut
* changes: DOCS ONLY. add manifest documentation for uses-feature and supports-screens elements. also update the navigation and manifest home page, update the uses-sdk element to include new maxSdk and targeSdk attributes, and add some sample code to DisplayMetrics to query the device for screen info.
This commit is contained in:
@@ -24,6 +24,9 @@ import android.os.*;
|
||||
/**
|
||||
* A structure describing general information about a display, such as its
|
||||
* size, density, and font scaling.
|
||||
* <p>To access the DisplayMetrics members, initialize an object like this:</p>
|
||||
* <pre> DisplayMetrics metrics = new DisplayMetrics();
|
||||
* getWindowManager().getDefaultDisplay().getMetrics(metrics);</pre>
|
||||
*/
|
||||
public class DisplayMetrics {
|
||||
/**
|
||||
|
||||
@@ -145,7 +145,9 @@
|
||||
<li><a href="<?cs var:toroot ?>guide/topics/manifest/provider-element.html"><provider></a></li>
|
||||
<li><a href="<?cs var:toroot ?>guide/topics/manifest/receiver-element.html"><receiver></a></li>
|
||||
<li><a href="<?cs var:toroot ?>guide/topics/manifest/service-element.html"><service></a></li>
|
||||
<li><a href="<?cs var:toroot ?>guide/topics/manifest/supports-screens-element.html"><supports-screens></a></li> <!-- ##api level 4## -->
|
||||
<li><a href="<?cs var:toroot ?>guide/topics/manifest/uses-configuration-element.html"><uses-configuration></a></li>
|
||||
<li><a href="<?cs var:toroot ?>guide/topics/manifest/uses-feature-element.html"><uses-feature></a></li> <!-- ##api level 4## -->
|
||||
<li><a href="<?cs var:toroot ?>guide/topics/manifest/uses-library-element.html"><uses-library></a></li>
|
||||
<li><a href="<?cs var:toroot ?>guide/topics/manifest/uses-permission-element.html"><uses-permission></a></li>
|
||||
<li><a href="<?cs var:toroot ?>guide/topics/manifest/uses-sdk-element.html"><uses-sdk></a></li>
|
||||
@@ -407,6 +409,9 @@
|
||||
<span class="zh-TW">附錄</span>
|
||||
</h2>
|
||||
<ul>
|
||||
<li><a href="<?cs var:toroot ?>guide/appendix/api-levels.html">
|
||||
<span class="en">Android API Levels</span>
|
||||
</a></li>
|
||||
<li><a href="<?cs var:toroot ?>guide/appendix/media-formats.html">
|
||||
<span class="en">Supported Media Formats</span>
|
||||
</a></li>
|
||||
|
||||
@@ -78,10 +78,11 @@ other mention of the element name.
|
||||
<a href="{@docRoot}guide/topics/manifest/permission-element.html"><permission /></a>
|
||||
<a href="{@docRoot}guide/topics/manifest/permission-tree-element.html"><permission-tree /></a>
|
||||
<a href="{@docRoot}guide/topics/manifest/permission-group-element.html"><permission-group /></a>
|
||||
|
||||
<a href="{@docRoot}guide/topics/manifest/instrumentation-element.html"><instrumentation /></a>
|
||||
|
||||
<a href="{@docRoot}guide/topics/manifest/uses-sdk-element.html"><uses-sdk /></a>
|
||||
<a href="{@docRoot}guide/topics/manifest/uses-configuration-element.html"><uses-configuration /></a> <!-- ##api level 3## -->
|
||||
<a href="{@docRoot}guide/topics/manifest/uses-feature-element.html"><uses-feature /></a> <!-- ##api level 4## -->
|
||||
<a href="{@docRoot}guide/topics/manifest/supports-screens-element.html"><supports-screens /></a> <!-- ##api level 4## -->
|
||||
|
||||
<a href="{@docRoot}guide/topics/manifest/application-element.html"><application></a>
|
||||
|
||||
@@ -115,7 +116,6 @@ other mention of the element name.
|
||||
<a href="{@docRoot}guide/topics/manifest/provider-element.html"></provider></a>
|
||||
|
||||
<a href="{@docRoot}guide/topics/manifest/uses-library-element.html"><uses-library /></a>
|
||||
<a href="{@docRoot}guide/topics/manifest/uses-configuration-element.html"><uses-configuration /></a> <!-- ##api level 3## -->
|
||||
|
||||
<a href="{@docRoot}guide/topics/manifest/application-element.html"></application></a>
|
||||
|
||||
@@ -146,13 +146,16 @@ add your own elements or attributes.
|
||||
<br/><code><a href="{@docRoot}guide/topics/manifest/provider-element.html"><provider></a></code>
|
||||
<br/><code><a href="{@docRoot}guide/topics/manifest/receiver-element.html"><receiver></a></code>
|
||||
<br/><code><a href="{@docRoot}guide/topics/manifest/service-element.html"><service></a></code>
|
||||
<br/><code><a href="{@docRoot}guide/topics/manifest/supports-screens-element.html"><supports-screens></a></code> <!-- ##api level 4## -->
|
||||
<br/><code><a href="{@docRoot}guide/topics/manifest/uses-configuration-element.html"><uses-configuration></a></code> <!-- ##api level 3## -->
|
||||
<br/><code><a href="{@docRoot}guide/topics/manifest/uses-feature-element.html"><uses-feature></a></code> <!-- ##api level 4## -->
|
||||
<br/><code><a href="{@docRoot}guide/topics/manifest/uses-library-element.html"><uses-library></a></code>
|
||||
<br/><code><a href="{@docRoot}guide/topics/manifest/uses-permission-element.html"><uses-permission></a></code>
|
||||
<br/><code><a href="{@docRoot}guide/topics/manifest/uses-sdk-element.html"><uses-sdk></a></code>
|
||||
</p>
|
||||
|
||||
|
||||
|
||||
|
||||
<h2 id="filec">File Conventions</h2>
|
||||
|
||||
|
||||
123
docs/html/guide/topics/manifest/supports-screens-element.jd
Normal file
123
docs/html/guide/topics/manifest/supports-screens-element.jd
Normal file
@@ -0,0 +1,123 @@
|
||||
page.title=<supports-screens>
|
||||
@jd:body
|
||||
|
||||
<dl class="xml">
|
||||
|
||||
<dt>syntax:</dt>
|
||||
<dd>
|
||||
<pre class="stx">
|
||||
<supports-screens android:<a href="#small">smallScreens</a>=["true" | "false"]
|
||||
android:<a href="#normal">normalScreens</a>=["true" | "false"]
|
||||
android:<a href="#large">largeScreens</a>=["true" | "false"]
|
||||
android:<a href="#any">anyDensity</a>=["true" | "false"] />
|
||||
</pre>
|
||||
</dd>
|
||||
|
||||
<dt>contained in:</dt>
|
||||
<dd><code><a href="{@docRoot}guide/topics/manifest/manifest-element.html"><manifest></a></code></dd>
|
||||
|
||||
<dt>description:</dt>
|
||||
<dd>Lets you specify the screen dimensions the
|
||||
application supports. By default a modern application (using API Level 4 or higher) supports all
|
||||
screen sizes and must explicitly disable certain screen sizes here;
|
||||
older applications are assumed to support only the "normal"
|
||||
screen size. Note that screen size is a separate axis from
|
||||
density. Screen size is determined as the available pixels to an application
|
||||
after density scaling has been applied.
|
||||
|
||||
<p>Based on the target device screen density, the Android
|
||||
framework will scale down assets by a factor of 0.75 (low dpi screens)
|
||||
or scale them up by a factor of 1.5 (high dpi screens).
|
||||
The screen density is expressed as dots-per-inch (dpi).</p>
|
||||
|
||||
<p>Currently supported densities:</p>
|
||||
<ul>
|
||||
<li>Low density: 120 dpi</li>
|
||||
<li>Medium density: 160 dpi</li>
|
||||
<li>High density: 240 dpi</li>
|
||||
</ul>
|
||||
|
||||
<p>Table of display types:</p>
|
||||
|
||||
<table>
|
||||
<tr>
|
||||
<th></th><th>Low Density</th><th>Medium Density</th><th>High Density</th>
|
||||
</tr>
|
||||
<tr>
|
||||
<th>Small Screen</th>
|
||||
<td>QVGA</td>
|
||||
<td>n/a</td>
|
||||
<td>VGA</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th>Normal Screen</th>
|
||||
<td>WQVGA</td>
|
||||
<td>HVGA</td>
|
||||
<td>WVGA, FWVGA</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th>Large Screen</th>
|
||||
<td>n/a</td>
|
||||
<td>VGA, WVGA, FWVGA</td>
|
||||
<td>n/a</td>
|
||||
</tr>
|
||||
</table>
|
||||
|
||||
</dd>
|
||||
|
||||
|
||||
<dt>attributes:</dt>
|
||||
|
||||
<dd>
|
||||
<dl class="attr"><dt><a name="small"></a>{@code android:smallScreens}</dt>
|
||||
<dd>Indicates whether the application supports smaller screen form-factors.
|
||||
A small screen is defined as one with a smaller aspect ratio than
|
||||
the "normal" (traditional HVGA) screen. An application that does
|
||||
not support small screens <em>will not be available</em> for
|
||||
small screen devices, because there is little the platform can do
|
||||
to make such an application work on a smaller screen. Applications using
|
||||
API Level 4 or higher default this to "true", others are "false".
|
||||
</dd>
|
||||
|
||||
<dt><a name="normal"></a>{@code android:normalScreens}</dt>
|
||||
<dd>Indicates whether an application supports the "normal" screen
|
||||
form-factors. Traditionally this is an HVGA medium density
|
||||
screen, but WQVGA low density and WVGA high density are also
|
||||
considered to be normal. This attribute is "true" by default,
|
||||
and applications currently should leave it that way.
|
||||
</dd>
|
||||
|
||||
<dt><a name="large"></a>{@code android:largeScreens}</dt>
|
||||
<dd>Indicates whether the application supports larger screen form-factors.
|
||||
A large screen is defined as a screen that is significantly larger
|
||||
than a "normal" phone screen, and thus may require some special care
|
||||
on the application's part to make good use of it. An application that
|
||||
does not support large screens will be placed as a "postage stamp" on
|
||||
such a screen, so that it retains the dimensions it was originally
|
||||
designed for. Applications using API Level 4 or higher default
|
||||
to "true", others are "false".
|
||||
</dd>
|
||||
|
||||
<dt><a name="any"></a>{@code android:anyDensity}</dt>
|
||||
<dd>Indicates whether the application can accommodate any screen
|
||||
density. Older applications (pre API Level 4) are assumed unable to
|
||||
accomodate all densities and this is "false" by default. Applications using
|
||||
API Level 4 or higher are assumed able to and this is "true" by default.
|
||||
You can explicitly supply your abilities here.
|
||||
</dd>
|
||||
|
||||
|
||||
</dl></dd>
|
||||
|
||||
<!-- ##api level indication## -->
|
||||
<dt>introduced in:</dt>
|
||||
<dd>API Level 4</dd>
|
||||
|
||||
<dt>see also:</dt>
|
||||
<dd>
|
||||
<ul>
|
||||
<li>{@link android.util.DisplayMetrics}</li>
|
||||
</ul>
|
||||
</dd>
|
||||
|
||||
</dl>
|
||||
@@ -168,9 +168,14 @@ The value must be one of the following strings:
|
||||
<dd>API Level 3</dd>
|
||||
|
||||
<dt>see also:</dt>
|
||||
<dd><code><a href="{@docRoot}guide/topics/manifest/activity-element.html#config">configChanges</a></code>
|
||||
<dd>
|
||||
<ul>
|
||||
<li><code><a href="{@docRoot}guide/topics/manifest/activity-element.html#config">configChanges</a></code>
|
||||
attribute of the
|
||||
<code><a href="{@docRoot}guide/topics/manifest/activity-element.html"><activity></a></code>
|
||||
element</dd>
|
||||
element</dd></li>
|
||||
<li>{@link android.content.pm.ConfigurationInfo}</li>
|
||||
</ul>
|
||||
</dd>
|
||||
|
||||
</dl>
|
||||
|
||||
52
docs/html/guide/topics/manifest/uses-feature-element.jd
Normal file
52
docs/html/guide/topics/manifest/uses-feature-element.jd
Normal file
@@ -0,0 +1,52 @@
|
||||
page.title=<uses-feature>
|
||||
@jd:body
|
||||
|
||||
<dl class="xml">
|
||||
|
||||
<dt>syntax:</dt>
|
||||
<dd>
|
||||
<pre class="stx">
|
||||
<uses-feature android:<a href="#glEsVersion">glEsVersion</a>=["true" | "false"] />
|
||||
</pre>
|
||||
</dd>
|
||||
|
||||
<dt>contained in:</dt>
|
||||
<dd><code><a href="{@docRoot}guide/topics/manifest/manifest-element.html"><manifest></a></code></dd>
|
||||
|
||||
<dt>description:</dt>
|
||||
<dd>This element specifies specific features used by the application.
|
||||
Android provides some features that may not be equally supported by all
|
||||
Android devices. In a manner similar to the <code><a href="uses-sdk-element.html"><uses-sdk></a></code>
|
||||
element, this element allows an application to specify which potentially variable
|
||||
features it requires. In this way, the application
|
||||
will not be installed on devices that do not offer the required feature.</p>
|
||||
|
||||
<p>For example, an application might specify that it requires a certain version of Open GL.
|
||||
If a device does not support that version of Open GL, then it will not allow installation of the application.</p>
|
||||
</dd>
|
||||
|
||||
|
||||
<dt>attributes:</dt>
|
||||
|
||||
<dd>
|
||||
<dl class="attr"><dt><a name="glEsVersion"></a>{@code android:glEsVersion}</dt>
|
||||
<dd>The GLES version needed by the application.
|
||||
The higher 16 bits represent the major number and the lower 16 bits
|
||||
represent the minor number. For example, for GL 1.2 referring to
|
||||
0x00000102, the actual value should be set as 0x00010002.
|
||||
</dd>
|
||||
</dl>
|
||||
</dd>
|
||||
|
||||
<!-- ##api level indication## -->
|
||||
<dt>introduced in:</dt>
|
||||
<dd>API Level 4</dd>
|
||||
|
||||
<dt>see also:</dt>
|
||||
<dd>
|
||||
<ul>
|
||||
<li>{@link android.content.pm.ConfigurationInfo}</li>
|
||||
</ul>
|
||||
</dd>
|
||||
|
||||
</dl>
|
||||
@@ -11,50 +11,68 @@ page.title=<uses-sdk>
|
||||
<dt>description:</dt>
|
||||
<dd>Lets you express an application's compatibility with one or more versions of the Android platform,
|
||||
by means of an API Level integer. The API Level expressed by an application will be compared to the
|
||||
API Level of a given Android system, which may vary among different Android devices. To declare your
|
||||
application's minimum API Level compatibility, use the <a href="#min">minSdkVersion</a> attribute.
|
||||
API Level of a given Android system, which may vary among different Android devices.
|
||||
</p>
|
||||
|
||||
<p>
|
||||
The default level is 1.
|
||||
</p>
|
||||
|
||||
<p>
|
||||
For more information on the API level, see the
|
||||
<a href="{@docRoot}guide/publishing/versioning.html#minsdkversion">Specifying
|
||||
Minimum System API Version</a> section of
|
||||
<a href="{@docRoot}guide/publishing/versioning.html">Versioning Your
|
||||
Applications</a>.
|
||||
</p></dd>
|
||||
|
||||
|
||||
<dt>attributes:</dt>
|
||||
<dd><dl class="attr">
|
||||
<dt><a name="min"></a>{@code android:minSdkVersion}</dt>
|
||||
<dd>An integer designating the minimum level of the Android API that's required
|
||||
for the application to run.
|
||||
|
||||
<p>
|
||||
Despite its name, this attribute specifies the API Level, <em>not</em> the
|
||||
Despite its name, this element is used to specify the API Level, <em>not</em> the
|
||||
version number of the SDK (software development kit). The API Level is always
|
||||
a single integer; the SDK version may be split into major and minor components
|
||||
(such as 1.5). You cannot derive the API Level from the SDK version number
|
||||
(for example, it is not the same as the major version or the sum of the major
|
||||
and minor versions). To learn what the API Level is, check the notes that
|
||||
came with the SDK you're using.</p>
|
||||
and minor versions).</p>
|
||||
|
||||
<p>Prior to installing an application, the Android system checks the value of this
|
||||
attribute and allows the installation only if the
|
||||
API Level is less than or equal to the API Level used by the system itself.</p>
|
||||
<p>For more information, read about
|
||||
<a href="{@docRoot}guide/appendix/api-levels.html">Android API Levels</a> and
|
||||
<a href="{@docRoot}guide/publishing/versioning.html">Versioning Your Applications</a>.
|
||||
</p></dd>
|
||||
|
||||
<p>If you do not declare this attribute, then a value of "1" is assumed, which
|
||||
indicates that your application is compatible with all versions of Android. If your
|
||||
application is <em>not</em> universally compatible (for instance if it uses APIs
|
||||
introduced in Android 1.5) and you have not declared the proper <code>minSdkVersion</code>,
|
||||
then when installed on a system with a lower API Level, the application
|
||||
will crash during runtime. For this reason, be certain to declare the appropriate API Level
|
||||
in the <code>minSdkVersion</code> attribute.</p>
|
||||
</dd>
|
||||
|
||||
<dt>attributes:</dt>
|
||||
|
||||
<dd>
|
||||
<dl class="attr">
|
||||
<dt><a name="min"></a>{@code android:minSdkVersion}</dt>
|
||||
<dd>An integer designating the minimum level of the Android API that's required
|
||||
for the application to run.
|
||||
|
||||
<p>Prior to installing an application, the Android system checks the value of this
|
||||
attribute and allows the installation only if it
|
||||
is less than or equal to the API Level used by the system itself.</p>
|
||||
|
||||
<p>If you do not declare this attribute, then a value of "1" is assumed, which
|
||||
indicates that your application is compatible with all versions of Android. If your
|
||||
application is <em>not</em> universally compatible (for instance if it uses APIs
|
||||
introduced in Android 1.5) and you have not declared the proper <code>minSdkVersion</code>,
|
||||
then when installed on a system with a lower API Level, the application
|
||||
will crash during runtime. For this reason, be certain to declare the appropriate API Level
|
||||
in the <code>minSdkVersion</code> attribute.</p>
|
||||
</dd>
|
||||
|
||||
<dt><a name="max"></a>{@code android:maxSdkVersion}</dt>
|
||||
<dd>An integer designating the maximum level of the Android API that the application is
|
||||
compatible with. You can use this to ensure your application is filtered out
|
||||
of later versions of the platform when you know you have incompatibility with them.</p>
|
||||
|
||||
<p>Prior to installing an application, the Android system checks the value of this
|
||||
attribute and allows the installation only it
|
||||
is greater than or equal to the API Level used by the system itself.</p>
|
||||
|
||||
<p>Introduced in: API Level 4</p>
|
||||
</dd>
|
||||
|
||||
<dt><a name="target"></a>{@code android:targetSdkVersion}</dt>
|
||||
<dd>An integer designating the API Level that the application is targetting.
|
||||
|
||||
<p>With this attribute set, the application says that is is be able to run on
|
||||
older versions (down to {@code minSdkVersion}), but was explicitly tested to work
|
||||
with the version specified here.
|
||||
Specifying this version allows the platform to disable compatibility
|
||||
code that is not required or enable newer features that are not
|
||||
available to older applications.</p>
|
||||
|
||||
<p>Introduced in: API Level 4</p>
|
||||
</dd>
|
||||
|
||||
</dl></dd>
|
||||
|
||||
|
||||
Reference in New Issue
Block a user