From 757714fd1568bea785af5738a499c968d994c3ba Mon Sep 17 00:00:00 2001 From: Scott Main <> Date: Wed, 22 Apr 2009 13:33:18 -0700 Subject: [PATCH] AI 147327: am: CL 147325 update the installing and upgrading docs for cupcake Original author: smain Merged from: //branches/cupcake/... Automated import of CL 147327 --- docs/html/sdk/1.5_r1/installing.jd | 324 ++++++++++++++++++++++++++++- docs/html/sdk/1.5_r1/upgrading.jd | 414 ++++++++++++++++++++++++++----------- 2 files changed, 618 insertions(+), 120 deletions(-) diff --git a/docs/html/sdk/1.5_r1/installing.jd b/docs/html/sdk/1.5_r1/installing.jd index a1f7cffb0576..bd366ff1add9 100644 --- a/docs/html/sdk/1.5_r1/installing.jd +++ b/docs/html/sdk/1.5_r1/installing.jd @@ -5,6 +5,328 @@ sdk.date=April 2009 page.title=Installing the Android SDK @jd:body -

See the Download page for more information.

+ +

This page describes how to install the Android SDK and set up your +development environment. If you haven't downloaded the SDK, you can +do so from the +Download page. Once you've downloaded +the SDK, return here.

+ +

If you encounter any problems during installation, see the +Installation Notes at the bottom of +this page.

+ +

Upgrading?

+

If you have already developed applications using an earlier version +of the SDK, please read +Upgrading the +SDK, instead. +

+ + +

Preparing for Installation

+ +

Before you begin, take a moment to confirm that your development machine meets the +System Requirements. +

+ +

If you will be developing on Eclipse with the Android Development +Tools (ADT) Plugin — the recommended path if you are new to +Android — make sure that you have a suitable version of Eclipse +installed on your computer (3.3 or newer). If you need to install Eclipse, you can +download it from this location:

+ +

http://www.eclipse.org/downloads/

+ +

A Java or RCP version of Eclipse is recommended.

+ +

Installing the SDK

+ +

After downloading the SDK, unpack the .zip archive to a suitable location on your machine. +By default, the SDK files are unpacked into a directory named +android_sdk_<platform>_<release>. +The directory contains a local copy of the documentation (accessible by opening +documentation.html in your browser) and the subdirectories +tools/, add-ons/, platforms/, and others. Inside +each subdirectory of platforms/ you'll find samples/, which includes +code samples that are specific to each version of the platform.

+ +

Make a note of the name and location of the unpacked SDK directory on your system — you +will need to refer to the SDK directory later, when setting up the Android plugin or when +using the SDK tools.

+ +

Optionally, you may want to add the location of the SDK's primary tools directory +to your system PATH. The primary tools/ directory is located at the root of the +SDK folder. Adding tools to your path lets you run Android Debug Bridge (adb) and +the other command line tools without +needing to supply the full path to the tools directory.

+ + +

Note that, if you update your SDK in the future, you +should remember to update your PATH settings to point to the new location, if different.

+ +

If you will be using the Eclipse IDE as your development environment, +the next section describes how to install the Android Development Tools plugin and set up Eclipse. +If you choose not to use Eclipse, you can +develop Android applications in an IDE of your choice and then compile, debug and deploy using +the tools included in the SDK (skip to Next Steps).

+ + +

Installing the ADT Plugin for Eclipse

+ +

Android offers a custom plugin for the Eclipse IDE, called Android +Development Tools (ADT), that is designed to give you a powerful, +integrated environment in which to build Android applications. It +extends the capabilites of Eclipse to let you quickly set up new Android +projects, create an application UI, add components based on the Android +Framework API, debug your applications using the Android SDK tools, and even export +signed (or unsigned) APKs in order to distribute your application.

+ +

In general, using Eclipse with ADT is a highly recommended +approach to Android development and is the fastest way to get started. +(If you prefer to work in an IDE other than Eclipse, +you do not need to install Eclipse or ADT, instead, you can directly +use the SDK tools to build and debug your application.)

+ +

Once you have Eclipse installed, as described in Preparing for +Installation, follow the steps below to +download the ADT plugin and install it in your respective Eclipse +environment.

+ + + + + + + +
Eclipse 3.3 (Europa)Eclipse 3.4 (Ganymede)
+ +
    +
  1. Start Eclipse, then select Help > Software Updates +> Find and Install....
  2. +
  3. In the dialog that appears, select Search for new features to install +and click Next.
  4. +
  5. Click New Remote Site.
  6. +
  7. In the resulting dialog box, enter a name for the remote site (e.g. "Android Plugin") and + enter the URL: +
    https://dl-ssl.google.com/android/eclipse/
    +

    If you have trouble aqcuiring the plugin, try using "http" in the URL, + instead of "https" (https is preferred for security reasons).

    +

    Click OK.

  8. +
  9. You should now see the new site added to the search list (and checked). + Click Finish.
  10. +
  11. In the subsequent Search Results dialog box, select the checkbox for the + Android Plugin. + This will select the nested tools: "Android DDMS" and "Android Developer Tools". + Click Next.
  12. +
  13. Read and accept the license agreement, then click Next.
  14. +
  15. On the following Installation window, click Finish.
  16. +
  17. The ADT plugin is not digitally signed. Accept the installation anyway + by clicking Install All.
  18. +
  19. Restart Eclipse.
  20. +
+ +
+ + +
    +
  1. Start Eclipse, then select Help > Software Updates....
  2. +
  3. In the dialog that appears, click the Available Software tab.
  4. +
  5. Click Add Site...
  6. +
  7. Enter the Location: +
    https://dl-ssl.google.com/android/eclipse/
    +

    If you have trouble aqcuiring the plugin, try using "http" in the Location URL, + instead of "https" (https is preferred for security reasons).

    +

    Click OK.

  8. +
  9. Back in the Available Software view, you should see the plugin listed by the URL, + with "Developer Tools" nested within it. Select the checkbox next to + Developer Tools and click Install...
  10. +
  11. On the subsequent Install window, "Android DDMS" and "Android Developer Tools" + should both be checked. Click Next.
  12. +
  13. Read and accept the license agreement, then click Finish.
  14. +
  15. Restart Eclipse.
  16. +
+ +
+ +

Now modify your Eclipse preferences to point to the Android SDK directory:

+
    +
  1. Select Window > Preferences... to open the Preferences + panel (Mac: Eclipse > Preferences).
  2. +
  3. Select Android from the left panel.
  4. +
  5. For the SDK Location in the main panel, click Browse... and +locate your downloaded SDK directory.
  6. +
  7. Click Apply, then OK.
  8. +
+ +

Done! If you haven't encountered any problems, then you're ready to +begin developing Android applications. See the +Next Steps section for suggestions on how to start.

+ + +

Troubleshooting ADT Installation

+

+If you are having trouble downloading the ADT plugin after following the steps above, here are +some suggestions:

+ + +

+If you are still unable to use Eclipse to download the ADT plugin as a remote update site, you +can download the ADT zip file to your local machine and manually install the it: +

+
    +
  1. Download the ADT zip file (do not unpack it).
  2. +
  3. Follow steps 1 and 2 in the default install instructions (above).
  4. +
  5. In Eclipse 3.3, click New Archive Site....
    + In Eclipse 3.4, click Add Site..., then Archive...
  6. +
  7. Browse and select the downloaded zip file.
  8. +
  9. Follow the remaining procedures, above, starting from steps 5.
  10. +
+

To update your plugin once you've installed using the zip file, you will have to +follow these steps again instead of the default update instructions.

+ +

Other install errors

+ +

Note that there are features of ADT that require some optional +Eclipse components (for example, WST). If you encounter an error when +installing ADT, your Eclipse installion might not include these components. +For information about how to quickly add the necessary components to your +Eclipse installation, see the troubleshooting topic +ADT +Installation Error: "requires plug-in org.eclipse.wst.sse.ui".

+ +

For Linux users

+

If you encounter this error when installing the ADT Plugin for Eclipse: +

+An error occurred during provisioning.
+Cannot connect to keystore.
+JKS
+

+...then your development machine lacks a suitable Java VM. Installing Sun +Java 6 will resolve this issue and you can then reinstall the ADT +Plugin.

+ + +

Next Steps

+

Once you have completed installation, you are ready to +begin developing applications. Here are a few ways you can get started:

+ +

Learn about Android

+ + +

Explore the SDK

+ + +

Explore some code

+ + +

Visit the Android developer groups

+ + + +

Installation Notes

+ +

Ubuntu Linux Notes

+ + + +

Other Linux Notes

+ + + diff --git a/docs/html/sdk/1.5_r1/upgrading.jd b/docs/html/sdk/1.5_r1/upgrading.jd index 532313110cb3..0b7312b3166f 100644 --- a/docs/html/sdk/1.5_r1/upgrading.jd +++ b/docs/html/sdk/1.5_r1/upgrading.jd @@ -2,175 +2,351 @@ page.title=Upgrading the SDK sdk.version=1.5_r1 @jd:body - +
  • UI +framework changes in Android 1.5 »
  • + - - - ---> + +

    This document describes how to move your development environment and existing +Android applications from an Android 1.0 or 1.1 SDK to the Android 1.5 SDK. +If you are migrating applications from an SDK older than 1.0, please also read the upgrading +document available in the Android 1.0 SDK package.

    -
    -
    +

    There are several compelling reasons to upgrade, such as new SDK tools +that make developing more efficient and new APIs that allow you to expand the feature-set +of your applications. However, even if you or your applications don't require these enhancements, +it's important that you upgrade to ensure that your applications run properly on the +Android 1.5 platform.

    -

    Upgrading quickview

    - +

    For more information on new SDK features and system changes, +see the Android 1.5 Version Notes.

    - -
    -
    -

    See the Download page for more information.

    +

    Install the SDK

    -
      -
    1. Select Help > Software Updates > Find and Install....
    2. -
    3. Select Search for updates of the currently installed features and click Finish.
    4. -
    5. If any update for ADT is available, select and install.
    6. -
    7. Restart Eclipse.
    8. +
    9. Select Help > Software Updates > + Manage Configuration.
    10. +
    11. Expand the list in the left panel to reveal the installed tools.
    12. +
    13. Right-click "Android Editors" and click Uninstall. Click OK + to confirm.
    14. +
    15. Restart Eclipse. +

      (Do not uninstall "Android Development Tools".)

    -

    Alternatively,

    + + +
      -
    1. Select Help > Software Updates > Manage Configuration.
    2. +
    3. Select Help > Software Updates.
    4. +
    5. Select the Installed Software tab.
    6. +
    7. Select "Android Editors". Click Uninstall.
    8. +
    9. In the next window, be sure "Android Editors" is checked, then click Finish + to uninstall.
    10. +
    11. Restart Eclipse. +

      (Do not uninstall "Android Development Tools".)

    12. +
    + + + + + +

    Install the 0.9 ADT plugin

    -
  • Navigate down the tree and select Android Development Tools <version>
  • -
  • Select Scan for Updates under Available Tasks.
  • +

    Only install the new plugin once you've completed the procedure to +Uninstall your previous ADT plugin.

    + + + + +
    Eclipse 3.3 (Europa)Eclipse 3.4 (Ganymede)
    + +
      +
    1. Select Help > Software Updates > + Find and Install.
    2. +
    3. Select Search for new features to install.
    4. +
    5. Select the Android plugin entry by checking the box next to it, + then click Finish. +

      (Your original entry for the plugin should still be here. If not, see the guide + to Installing the ADT Plugin.) +

    6. +
    7. In the results, be sure that "Developer Tools" is checked, then click Next.
    8. +
    9. Read and accept the license agreement, then click Next. +
    10. In the next window, click Finish to start installation.
    11. +
    12. The ADT plugin is not digitally signed. Accept the installation anyway by clicking + Install All.
    13. +
    14. Restart Eclipse.
    +
      -
    1. Select Help > Software Updates...
    2. -
    3. Select the Installed Software tab.
    4. -
    5. Click Update...
    6. -
    7. If an update for ADT is available, select it and click Finish.
    8. +
    9. Select Help > Software Updates.
    10. +
    11. Select the Available Software tab.
    12. +
    13. Expand the entry for the Andriod plugin (may be listed as the location URL) + and select "Developer Tools" by checking the box next to it, then click Install. +
    14. On the next window, "Android DDMS" and "Android Developer Tools" + should both be checked. Click Next. +
    15. Read and accept the license agreement, then click Finish.
    16. Restart Eclipse.
    -

    Update your Eclipse SDK Preferences

    +

    If you encounter problems, ensure your ADT is fully uninstalled and then +follow the guide to +Installing the ADT Plugin +for Eclipse.

    + +

    Update your Eclipse SDK Preferences

    The last step is to update your Eclipse preferences to point to the new SDK directory:

      -
    1. Select Window > Preferences... to open the Preferences panel. (Mac OSX: Eclipse > Preferences)
    2. +
    3. Select Window > Preferences to open the Preferences + panel (Mac: Eclipse > Preferences).
    4. Select Android from the left panel.
    5. -
    6. For the SDK Location in the main panel, click Browse... and locate the SDK directory.
    7. +
    8. For the SDK Location in the main panel, click Browse + and locate your SDK directory.
    9. Click Apply, then OK.
    -

    Migrate Your Applications, if Necessary

    -

    If (and only if) you have written apps in an SDK released previous to -the Android 1.0 SDK, you will need to migrate your applications. After -installing the new SDK and updating the ADT Plugin (if applicable), you -may encounter breakages in your application code, due to -framework and API changes. You'll need to update your code to match the -latest APIs.

    +

    Update Your Projects

    + +

    You will now need to update any and all Android projects that you have +developed using a previous version of the Android SDK.

    + + +

    Eclipse users

    + +

    If you use Eclipse to develop applications, use the following procedure to +update each project:

    + +
      +
    1. Right-click on the individual project (in the Package Explorer) + and select Properties.
    2. +
    3. In the properties, open the Android panel and select a "build target" to compile + against. This SDK offers the Android 1.1 and Android 1.5 platforms to choose from. When + you are initially updating your projects to the new SDK, we recommend that you select a build + target with the Android 1.1 platform. Click Apply, then + OK.
    4. +
    + +

    The new plugin creates a gen/ folder in your project, in which it puts the +R.java file +and all automatically generated AIDL java files. If you get an error such as +The type R is already defined, +then you probably need to delete your old R.java or your old auto-generated +AIDL Java files in the src/ folder. +(This does not apply to your own hand-crafted parcelable AIDL java files.)

    + +

    Note that, with the Android 1.5 SDK, there is a new process for running +applications in the Android Emulator. +Specifically, you must create an Android Virtual Device (AVD) before you can launch an instance +of the Emulator. Before attempting to run your applications with the new SDK, +please continue with the section below to +Migrate Your Applications.

    + + +

    Ant users

    + +

    If you build your projects using the Ant tool (rather than with Eclipse), note the +following changes with the new SDK tools.

    + +

    build.xml has changed

    + +

    You must re-create your build.xml file.

    + +

    If you had customized your build.xml, first make a copy of it:

    + +
    +$ cd my-project
    +$ cp build.xml build.xml.old
    +
    -

    One way to start is to open your project in Eclipse and see where the ADT -identifies errors in your application. You can also look up -specific changes in the Android APIs in the -android-1.5.html#api-changes -Android 1.5 Version Notes +

    Now use the new android tool (located in your_sdk/tools/) +to create a new build.xml that references +a specific platform target:

    -document.

    +
    $ android update project --path /path/to/my-project --target 1
    + +

    The "target" corresponds to an Android platform library (including any add-ons, such as +Google APIs) that you would like to build your project against. You can view a list of available +targets (and their corresponding integer ID) with the command, android list targets. +When you are initially updating your projects to the new SDK, we recommend that you select the +first target ("1"), which uses the Android 1.1 platform library.

    + +

    A gen/ folder will be created the first time you build and your R.java and +your AIDL Java files will be generated in here. You must remove +the old R.java and old auto-generated AIDL java files from the +src/ folder. (This +does not apply to your own hand-crafted parcelabe AIDL java files.)

    + +

    Note: The "activitycreator" tool has been replaced +by the new "android" tool. For information on creating new projects with the android tool, +see the documentation about Developing +In Other IDEs.

    + +

    Note that, with the Android 1.5 SDK, there is a new process for running +applications in the Android Emulator. +Specifically, you must create an Android Virtual Device (AVD) before you can launch an instance +of the Emulator. Before attempting to run your applications with the new SDK, +please continue with the section below to +Migrate Your Applications.

    + + +

    Migrate Your Applications

    + +

    After you have completed the process above to Update Your +Projects, you are strongly encouraged to run each of your applications in an instance +of the emulator running the Android 1.5 system image. It's possible (however, unlikely) +that you'll encounter some breakage in your application when you run your applications on +the Android 1.5 system image. Whether you believe your application will be affected by +platform changes or not, it's very important that you test the application's +forward-compatibility on Android 1.5.

    + +

    To test forward-compatibility, simply run your existing application (as-is) on an Android +Emulator that's running the Android 1.5 system image. The following procedure will guide +you through the process to running your existing applications on an emulator. Please read +the following guide completely before you begin.

    + +

    To test your application on an emulator running Android 1.5:

    +
      +
    1. Update Your Project (you should have done this + already, in the section above).
    2. +
    3. Run your existing project, as-is, on an emulator running the Android 1.5 system image. +

      As mentioned in the guide to Update Your Projects, + you should have selected a "build + target" of "1", which compiles your application against the Android 1.1 system image, so there + should be no new errors in your code.

      +

      Eclipse users: follow the + Eclipse guide to + Running Your Application.

      +

      Ant users: follow the + Ant guide to + Running Your Application +

      During the procedure to Running Your Application, select a "deployment target" + for the AVD that includes the Android 1.5 platform. + If your application utilizes the Google Maps APIs (i.e., + MapView), be certain to select a target that includes the Google APIs.

      +

      Once you complete the procedures to run your application in your respective environment, + linked above, return here.

      +
    4. +
    5. With your application running in the emulator, perform all regular testing on the application + to ensure that it functions normally (in both landscape and portrait orientations).
    6. +
    + +

    Chances are, your application runs just fine on the Android 1.5 platform — +new devices will be able to safely install and run your application and +current users who update their devices will be able to continue using your application as usual. +However, if something doesn't work the way you expect, then you might need to revisit +your project and make any necessary changes to your code.

    + +

    You can check for code breakages caused by API changes by opening your project +in Eclipse, changing the "build target" to one using the Android 1.5 platform, +and see where the ADT identifies errors in your code.

    + +

    There have been several API additions made for this release, but there have been +very few actual API changes. Only a couple (relatively unused) elements +have been removed and a few have been deprecated, so your applications written with the +Android 1.1 system library should work just fine. +Your application will be at highest risk of breakage if it uses Android APIs +that are not available in the public API documentation +or if it explicitly depends on system bugs. For information +about changes made to Android 1.5, refer to the following documents:

    +

    If you have additional trouble updating your code, visit the Android Developers Group to seek help from other Android developers.

    - -

    If you have modified one of the ApiDemos applications and would like to migrate it -to the new SDK, note that you will need to uninstall the version of ApiDemos that comes -preinstalled in the emulator. For more information, or if you encounter an "reinstallation" -error when running or installing ApiDemos, see the troubleshooting topic -I can't install ApiDemos -apps in my IDE because of a signing error for information about how to solve the problem.

    ---> \ No newline at end of file -- 2.11.0