diff --git a/core/java/android/util/DisplayMetrics.java b/core/java/android/util/DisplayMetrics.java index dd5a4401c4d51..74f01cc871975 100644 --- a/core/java/android/util/DisplayMetrics.java +++ b/core/java/android/util/DisplayMetrics.java @@ -24,6 +24,9 @@ import android.os.*; /** * A structure describing general information about a display, such as its * size, density, and font scaling. + *

To access the DisplayMetrics members, initialize an object like this:

+ *
 DisplayMetrics metrics = new DisplayMetrics();
+ * getWindowManager().getDefaultDisplay().getMetrics(metrics);
*/ public class DisplayMetrics { /** diff --git a/docs/html/guide/guide_toc.cs b/docs/html/guide/guide_toc.cs index 21271872739dd..11f8c7bd72d91 100644 --- a/docs/html/guide/guide_toc.cs +++ b/docs/html/guide/guide_toc.cs @@ -145,7 +145,9 @@
  • <provider>
  • <receiver>
  • <service>
  • +
  • <supports-screens>
  • <uses-configuration>
  • +
  • <uses-feature>
  • <uses-library>
  • <uses-permission>
  • <uses-sdk>
  • @@ -407,6 +409,9 @@ 附錄 + diff --git a/docs/html/guide/topics/manifest/uses-feature-element.jd b/docs/html/guide/topics/manifest/uses-feature-element.jd new file mode 100644 index 0000000000000..2626735cae115 --- /dev/null +++ b/docs/html/guide/topics/manifest/uses-feature-element.jd @@ -0,0 +1,52 @@ +page.title=<uses-feature> +@jd:body + +
    + +
    syntax:
    +
    +
    +<uses-feature android:glEsVersion=["true" | "false"] />
    +
    +
    + +
    contained in:
    +
    <manifest>
    + +
    description:
    +
    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 <uses-sdk> +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.

    + +

    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.

    +
    + + +
    attributes:
    + +
    +
    {@code android:glEsVersion}
    +
    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. +
    +
    +
    + + +
    introduced in:
    +
    API Level 4
    + +
    see also:
    +
    + +
    + +
    diff --git a/docs/html/guide/topics/manifest/uses-sdk-element.jd b/docs/html/guide/topics/manifest/uses-sdk-element.jd index b6e73746cfd68..adcdc286cbed5 100644 --- a/docs/html/guide/topics/manifest/uses-sdk-element.jd +++ b/docs/html/guide/topics/manifest/uses-sdk-element.jd @@ -11,50 +11,68 @@ page.title=<uses-sdk>
    description:
    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 minSdkVersion attribute. +API Level of a given Android system, which may vary among different Android devices.

    -The default level is 1. -

    - -

    -For more information on the API level, see the -Specifying -Minimum System API Version section of -Versioning Your -Applications. -

    - - -
    attributes:
    -
    -
    {@code android:minSdkVersion}
    -
    An integer designating the minimum level of the Android API that's required -for the application to run. - -

    -Despite its name, this attribute specifies the API Level, not the +Despite its name, this element is used to specify the API Level, not 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.

    +and minor versions).

    -

    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.

    +

    For more information, read about +Android API Levels and +Versioning Your Applications. +

    -

    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 not universally compatible (for instance if it uses APIs -introduced in Android 1.5) and you have not declared the proper minSdkVersion, -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 minSdkVersion attribute.

    -
    + +
    attributes:
    + +
    +
    +
    {@code android:minSdkVersion}
    +
    An integer designating the minimum level of the Android API that's required + for the application to run. + +

    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.

    + +

    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 not universally compatible (for instance if it uses APIs + introduced in Android 1.5) and you have not declared the proper minSdkVersion, + 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 minSdkVersion attribute.

    +
    + +
    {@code android:maxSdkVersion}
    +
    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.

    + +

    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.

    + +

    Introduced in: API Level 4

    +
    + +
    {@code android:targetSdkVersion}
    +
    An integer designating the API Level that the application is targetting. + +

    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.

    + +

    Introduced in: API Level 4

    +