From 98c2e56f8bbfc27f4e2c214e49a7843d16509dbe Mon Sep 17 00:00:00 2001 From: Joe Malin Date: Thu, 28 Mar 2013 11:34:05 -0700 Subject: Fix #8499531: Command line instructions Change-Id: I4922855443f1f85e52ad4016ea3e33925c60e08e --- docs/html/tools/extras/support-library.jd | 63 ++++++++++++++++++++++++------- 1 file changed, 50 insertions(+), 13 deletions(-) diff --git a/docs/html/tools/extras/support-library.jd b/docs/html/tools/extras/support-library.jd index 6475e3c..9fc2699 100644 --- a/docs/html/tools/extras/support-library.jd +++ b/docs/html/tools/extras/support-library.jd @@ -524,7 +524,7 @@ and click Install selected.
  • Proceed to install the package.
  • -

    When done, all files (including source code, samples, and the {@code .jar} files) are saved +

    When done, all files (including source code, samples, and the JAR files) are saved into the <sdk>/extras/android/support/ directory. This directory contains each of the different support libraries, such as the library for API level 4 and up and the library for API level 13 and up, each named with the respective version (such as {@code v4/}).

    @@ -533,20 +533,57 @@ for API level 13 and up, each named with the respective version (such as {@code

    Setting Up a Project to Use a Library

    To add one of the libraries to your Android project:

    +
    +
    + Add the JAR file to your project. +
    +
    + Copy the JAR file for the library you want to use into your Android project. To do this: +
      +
    • + Create the directory {@code libs/} at the root of your project + (next to {@code src/}, {@code res/}, and so forth). +
    • +
    • + Locate the JAR file for the library you want to use and copy it into the + {@code libs/} directory. +

      + For example, the library that supports API level 4 and up is located at + {@code <sdk>/extras/android/support/v4/android-support-v4.jar}. +

      +
    • +
    +

    + Your build system may expect to find the JAR file in a directory other than + {@code libs}. Read the documentation for your build system to learn where to put the + JAR file. +

    +
    +
    + If necessary, add the {@code libs/} directory to your build path. +
    +
    + Read the documentation for your build system to learn how to add the JAR file to the + build path. +
    +
    +

    + To confirm that you've added the JAR file to the correct directory and added it to the build + path: +

      -
    1. In your Android project, create a directory named {@code libs} at the root of your -project (next to {@code src/}, {@code res/}, etc.)
    2. -
    3. Locate the JAR file for the library you want to use and copy it into the {@code -libs/} directory. -

      For example, the library that supports API level 4 and up is located at {@code -<sdk>/extras/android/support/v4/android-support-v4.jar}.

      -
    4. -
    5. Add the JAR to your project build path. -

      In Eclipse, right-click the JAR file in the Package Explorer, select Build -Path > Add to Build Path.

      -
    6. +
    7. + Edit one of your source files to add an {@code import} statement that imports a + class from the {@code android.support.*} package. +
    8. +
    9. + Build your app. The code should compile cleanly. +
    10. +
    11. + As a double-check, run your app. It should run correctly, without any runtime exceptions + indicating that the class in {@code android.support.*} can't be found. +
    -

    Your application is now ready to use the library APIs. All the provided APIs are available in the {@code android.support} package (for example, {@code android.support.v4}).

    -- cgit v1.1