[FW]ADT Plugin for Eclipse

上一篇 / 下一篇  2011-07-05 14:20:41 / 个人分类:Android

ADT Plugin for Eclipse

Android Development Tools (ADT) is a plugin for the Eclipse IDE that is designed to give you a powerful, integrated environment in which to build Android applications.

ADT extends the capabilities 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).apkfiles in order to distribute your application.

Developing in Eclipse with ADT is highly recommended and is the fastest way to get started. With the guided project setup it provides, as well as tools integration, custom XML editors, and debug ouput pane, ADT gives you an incredible boost in developing Android applications.

This document provides step-by-step instructions on how to download the ADT plugin and install it into your Eclipse development environment. Note that before you can install or use ADT, you must have compatible versions of both the Eclipse IDE and the Android SDK installed. For details, make sure to readInstalling the ADT Plugin, below.

If you are already using ADT, this document also provides instructions on how to update ADT to the latest version or how to uninstall it, if necessary.

Revisions

The sections below provide notes about successive releases of the ADT Plugin, as denoted by revision number.

ADT 11.0.0(June 2011)
Dependencies:
ADT 11.0.0 is designed for use with SDK Tools r11. If you haven't already installed SDK Tools r11 into your SDK, use the Android SDK and AVD Manager to do so.
Visual Refactoring:
  • "Extract Style" feature pulls out style-related attributes from your layout and extracts them as a new style. defined instyles.xml(more info).
  • "Wrap in Container" feature lets you select a group of views then surround them in a new layout (a new view group, such as a LinearLayout), and transfers namespace and layout parameters to the new parent (more info).
  • "Change Layout" feature changes layouts from one type to another, and can also flatten a layout hierarchy (more info).
  • "Change Widget Type" feature changes the type of the selected views to a new type. Also, a new selection context menu in the visual layout editor makes it easy to select siblings as well as views anywhere in the layout that have the same type (more info).
  • "Extract as Include" feature finds identical collections of views in other layouts and offers to combine them into a single layout that you can then include in each layout (more info).
  • Quick Assistant in Eclipse can be invoked from the XML editor (with Ctrl-1) to apply any of the above refactorings (and Extract String) to the current selection (more info).
Visual Layout Editor:
  • This is the update to the layout editor you've been waiting for! It includes (almost) all the goodies demonstrated at Google I/O.Watch the videoon YouTube.
  • The palette now supports different configurations for supported widgets. That is, a single view is presented in various different configurations that you can drag into your layout. For example, there is aText Fieldspalette category where you can drag anEditTextwidget in as a password field, an e-mail field, a phone field, or other types of text boxes. Similarly,TextViewwidgets are preconfigured with large, normal and small theme sizes, andLinearLayoutelements are preconfigured in horizontal and vertical configurations (more info).
  • The palette supports custom views. You can pick up any custom implementations of the View class you've created in your project or from included libraries and drag them into your layout (more info).
  • Fragments are available in the palette for placement in your layout. In the tool, you can choose which layout to show rendered for a given fragment tag. Go to declaration works for fragment classes (more info).
  • The layout editor automatically applies a "zoom to fit" for newly opened files as well as on device size and orientation changes to ensure that large layouts are always fully visible unless you manually zoom in.
  • You can drop in an<include>element from the palette, which will pop up a layout chooser. When you select the layout to include, it is added with an<include>. Similarly, dropping images or image buttons will pop up image resource choosers (more info).
  • The configuration chooser now applies the "Render Target" and "Locale" settings project wide, making it trivial to check the layouts for different languages or render targets without having to configure these individually for each layout.
  • The layout editor is smarter about picking a default theme to render a layout with, consulting factors like theme registrations in the manifest, the SDK version, and other factors.
  • The layout editor is smarter about picking a default configuration to render a layout with, defaulting to the currently visible configuration in the previous file. It also considers the SDK target to determine whether to default to a tablet or phone screen size.
  • Basic focus support. The first text field dropped in a layout is assigned focus, and there areRequest FocusandClear Focuscontext menu items on text fields to change the focus.
XML editors:
  • Code completion has been significantly improved. It now works with<style>elements, completes dimensional units, sorts resource paths in values based on the attribute name, and more. There are also many fixes to handle text replacement (more info).
  • AAPT errors are handled better. They are now underlined for the relevant range in the editor, and a new quickfix makes it trivial to create missing resources.
  • Code completion for drawable, animation and color XML files (more info).
DDMS:
  • "New Folder" action in the File Explorer.
  • The screenshot dialog will add timestamps to the filenames and preserve the orientation on snapshot refresh.
General notes:
  • TraceView supports zooming with the mouse-wheel in the timeline.
  • The New Android Project wizard now supports Eclipse working sets.

More information about tool changes are available on theAndroid Tools Project Site.

ADT 10.0.1(March 2011)
Dependencies:
ADT 10.0.1 is designed for use with SDK Tools r10. If you haven't already installed SDK Tools r10 into your SDK, use the Android SDK and AVD Manager to do so.
General notes:
  • Temporary work-around to resolve the rare cases in which the layout editor will not open.
  • Fix issue in which ADT 10.0.0 would install on Eclipse 3.4 and lower, even though ADT requires Eclipse 3.5 or higher (as of 10.0.0).
ADT 10.0.0(February 2011)
Dependencies:
ADT 10.0.0 is designed for use with SDK Tools r10. If you haven't already installed SDK Tools r10 into your SDK, use the Android SDK and AVD Manager to do so.
General notes:
  • The tools now automatically generate Java Programming Language source files (in thegen/directory) and bytecode (in theres/raw/directory) from your.rsfiles.
  • A Binary XML editor has been added (details).
  • Traceview is now integrated into the Eclipse UI (details).
  • The "Go To Declaration" feature for XML and.javafiles quickly show all the matches in the project and allows you jump to specific items such as string translations oronClickhandlers (details).
  • The Resource Chooser can create items such as dimensions, integers, ids, and booleans (details).
  • Improvements to the Visual Layout Editor:
    • A new Palette with categories and rendering previews (details).
    • A Layout Actions bar that provides quick access to common layout operations (details).
    • When the Android 3.0 rendering library is selected, layouts render more like they do on devices. This includes rendering of status and title bars to more accurately reflect the actual screen space available to applications (details).
    • Zoom improvements such as fit to view, persistent scale, and keyboard access. (details).
    • Further improvements to<merge>layouts, as well as layouts with gesture overlays (details).
    • Improved rendering error diagnostics.
ADT 9.0.0(January 2011)
Dependencies:
ADT 9.0.0 is designed for use with SDK Tools r9. If you haven't already installed SDK Tools r9 into your SDK, use the Android SDK and AVD Manager to do so.
General notes:
  • "Go To Declaration" hyperlink support: You can jump directly from code references (such asR.id.main) to the corresponding XML declaration, or from XML attributes (such as@string) to the corresponding resource definition, or from manifest XML registrations to activities and services.
  • Improvements were made to name refactoring.
  • AVDs now automatically save their state, so they can restart almost instantly. You can enable this feature when creating an AVD or by editing an AVD with the AVD Manager.
  • Improvements to the Visual Layout Editor:
    • Support for rendering targets: You can now choose an arbitrary Android platform. to render the current page, regardless of the project's minimum platform. This makes it easy to verify the layout and appearance of your activity on different versions of the platform.
    • Improved support for empty and nested layouts: Dragging items over nested and invisible layouts automatically enlarges and highlights these layouts, so that they can receive drops.
    • XML formatting improvements: The editor generates cleaner XML and you can now enable XML auto-formatting in thePreferencesmenu.
    • Improved Outline labels: The Outline tab now displays additional information about each View. Textual Views display a snippet of the actual text. Views with a source (such as ImageView) displays the resource name. Included Views display the name of the View.
    • When you right click a View in the Layout Editor, the context menu now containsEdit ID...andEdit Text...items. TheProperties...context menus now list all of the properties and provide a way to edit them (Details).
    • The layout editor now properly handles<include>and<merge>tags (Details).
    • "Extract as Include" refactoring: The Layout Editor has a new refactoring that allows you to select one or more views in a layout, and extract it into a separate layout (Details).
    • Improved diagnostics for class loading and rendering errors: Class loading and rendering error messages are more useful and provide better information about the root cause of the error.
    • Improved error handling to prevent drag and reordering operations from adding children into anAdapterView.
    • Outline reordering: Reordering your views in the Outline tab is much easier (Details).
    • Fix for keybinding bug where keyboard shortcuts did not work (Issues13231and13134).
    • Fix for problems with Custom layout attribute menu (Issue13134).
    • Automatic configuration for various view types: Certain views have properties configured by default. For example, the width of anEditTextobject is set tomatch_parentwhen added to a verticalLinearLayoutor a default image is added to anImageButton.
    • Previews during dragging: Dragging from the palette or dragging within the layout editor now shows live previews of the dragged item.
    • Navigation improvements: In the Layout Editor, double-clicking Views jumps to the corresponding XML element. In the Outline view, double-clicking opens the Properties view.
    • The editor has Honeycomb style. animation preview support.
    • Improved rendering support for various Views (such as TabHosts and SlidingDrawers) in Honeycomb (Issues3162and13092).
    • Included layouts can be rendered and edited in the context of the layouts that include them. From a layout using an<include>tag, double-clicking on the<include>element edits the referenced layout in the context of the current layout. Additionally, when editing a layout that is included by other layouts, you can quickly change between context layouts, by right clicking in the editor and choosingShow included in.... This feature is only available in Honeycomb.
  • This release fixes many other bugs, but the most important ones are listed below:
    • Fixed issue that prevented launching debug builds on productions devices whendebuggable=truewas not set in the Android manifest.
    • The LogCat view in DDMS properly handles UTF-8 characters.
    • The SDK Manager is more reliable on Windows (Details).
    • A JUnit initialization bug that prevented you from working with JUnit tests was fixed (Issue12411).
ADT 8.0.1(December 2010)
Dependencies:

ADT 8.0.1 is designed for use with SDK Tools r8. If you haven't already installed SDK Tools r8 into your SDK, use the Android SDK and AVD Manager to do so.

General notes:
  • This is a quick follow-up to ADT 8.0.0 to fix some bugs.
  • Fixes an issue in which projects failed to compile, citing a dex error.
  • Better ProGuard error reporting when exporting applications for release.

Also see the recent release notes for 8.0.0, below.

ADT 8.0.0(December 2010)
Dependencies:

ADT 8.0.0 is designed for use with SDK Tools r8. If you haven't already installed SDK Tools r8 into your SDK, use the Android SDK and AVD Manager to do so.

General notes:
  • New version number scheme that follows the SDK Tools revision number. The major version number for your ADT plugin should now always match the revision number of your SDK Tools. For example, ADT 8.x is for SDK Tools r8.
  • Support for true debug build. You no longer need to change the value of thedebuggableattribute in the Android Manifest.

    Incremental builds automatically insertdebuggable="true", but if you perform. "export signed/unsigned application package", ADT doesnotinsert it. If you manually setdebuggable="true"in the manifest file, then release builds will actually create a debug build (it does not remove it if you placed it there).

  • AutomaticProGuardsupport in release builds. For it to work, you need to have aproguard.configproperty in thedefault.propertiesfile that points to a ProGuard config file.
  • Completely rewritten Visual Layout Editor. (This is still a work in progress.) Now includes:
    • Full drag and drop from palette to layout for all Layout classes.
    • Move widgets inside a Layout view, from one Layout view to another and from one layout file to another.
    • Contextual menu with enum/flag type properties.
    • New zoom controls.
  • New HierarchyViewer plug-in integrated in Eclipse.
  • Android launch configurations don't recompile the whole workspace on launch anymore.
  • android.jarsource and javadoc location can now be configured.
ADT 0.9.9(September 2010)
Dependencies:

ADT 0.9.9 replaces ADT 0.9.8 and is designed for use with SDK Tools r7 and later. ADT 0.9.9 includes the ADT 0.9.8 features as well as an important bugfix, so we recommend that you upgrade as soon as possible. If you haven't already installed SDK Tools r7 into your SDK, use the Android SDK Manager to do so.

General notes:
  • Fixes a problem in project import, in which source files were deleted in some cases.
  • Includes all other ADT 0.9.8 features (see below).
ADT 0.9.8(September 2010)
    Dependencies:

    ADT 0.9.8 is now deprecated. Please use ADT 0.9.9 instead.

    General notes:
    • Adds a new Action, "Rename Application Package", to the Android Tools contextual menu. The Action does a full application package refactoring.
    • Adds support for library projects that don't have a source folder calledsrc/. There is now support for any number of source folders, with no name restriction. They can even be in subfolder such assrc/java. If you are already working with library projects created in ADT 0.9.7, seeMigrating library projects to ADT 0.9.8for important information about moving to the new ADT environment.
    • Adds support for library projects that depend on other library projects.
    • Adds support for additional resource qualifiers:car/desk,night/notnightandnavexposed/navhidden.
    • Adds more device screen types in the layout editor. All screen resolution/density combinations listed in theSupporting Multiple Screensare now available.
    • Fixes problems with handling of library project names that contain characters that are incompatible with the Eclipse path variable. Now properly sets up the link between the main project and the library project.
    ADT 0.9.7(May 2010)
    Library projects:

    The ADT Plugin now supports the use oflibrary projectsduring development, a capability that lets you store shared Android application code and resources in a separate development project. You can then reference the library project from other Android projects and, at build time, the tools compile the shared code and resources as part of the dependent applications. More information about this feature is available in theCreating and Managing Projectsdocument.

    If you are not developing in Eclipse,SDK Tools r6provides the equivalent library project support through the Ant build system.

    ADT 0.9.6(March 2010)
    Dependencies:

    ADT 0.9.6 is designed for use with SDK Tools r5 and later. Before updating to ADT 0.9.6, we highly recommend that you use the Android SDK and AVD Manager to install SDK Tools r5 into your SDK.

    General Notes:
    • Editingdefault.propertiesoutside of Eclipse will now automatically update the project.
    • Loads the SDK content only when a project requires it. This will make Eclipse use less resources when the SDK contains many versions of Android.
    • Resolves potential deadlock between modal dialogs, when launching ADT the first time with the SDK Usage panel.
    • Fixes issues with the New Project Wizard when selecting samples.
    AVD/SDK Manager:
    • Adds support for platform. samples components.
    • Improves support for dependency between components.
    • AVDs now sorted by API level.
    • The AVD creation dialog now enforces a minimum SD card size of 9MB.
    • Prevents deletion of running AVDs.
    DDMS:
    • DDMS plug-in now contains the Allocation Tracker view.
    • New action in the Logcat view: "Go to problem" lets you go directly from an exception trace output to the code.
    Editors:
    • Explode mode in the Visual Layout Editor adds a margin to all layout objects so that it's easier to see embedded or empty layouts.
    • Outline mode in the Visual Layout Editor draws layout outline to make it easier to see layout objects.
    • Several fixes in the configuration selector of the Visual Layout Editor.
    Application launching:
    • Applications launched from ADT now behave as if they were clicked from the Home screen.
    • Fixes issue where add-on with no optional library would not show up as valid targets for application launches.
    • Resolves possible crash when launching applications.
    ADT 0.9.5(December 2009)
    Dependencies:

    ADT 0.9.5 requires features provided in SDK Tools r4 or higher. If you install ADT 0.9.5, which is highly recommended, you should use the Android SDK and AVD Manager to download the latest SDK Tools into your SDK. For more information, seeAdding SDK Components.

    General Notes:
    • AVD Launch dialog now shows scale value.
    • Fixes potential NPE in SDK Manager on AVD launch, for older AVD with no skin name specified.
    • Fixes XML validation issue in on older Java versions.
    • .apk packaging now properly ignores vi swap files as well as hidden files.
    ADT 0.9.4(October 2009)
    Dependencies:

    ADT 0.9.4 requires features provided in SDK Tools r3 or higher. If you install ADT 0.9.4, which is highly recommended, you should use the Android SDK and AVD Manager to download the latest SDK Tools into your SDK. For more information, seeAdding SDK Components.

    Project Creation Wizard:
    • New option to create a project from a sample by choosing it from a list.
    Layout Editor:
    • Improved Configuration selector that lets you see how your layout will render on different devices. Default device descriptions include ADP1 and Google Ion, while SDK add-ons can also provide new descriptions. A new UI allows you to create custom descriptions.
    • Adds a new clipping toggle, to let you see your full layout even if it's bigger than the screen.
    DDMS Integration:
    • Includes the improvements from the standlone DDMS, revision 3.
    • Adds an option to open HPROF files into eclipse instead of writing them on disk. If a profiler such as MAT (Memory Analyzer Tool) is installed, it'll open the file.
    Android SDK and AVD Manager integration:
    • Includes the improvements from the standalone Android SDK and AVD Manager, revision 3.

    Installing the ADT Plugin

    The sections below provide instructions on how to download and install ADT into your Eclipse environment. If you encounter problems, see theTroubleshootingsection.

    Preparing Your Development Computer

    ADT is a plugin for the Eclipse IDE. Before you can install or use ADT, you must have a compatible version of Eclipse installed on your development computer. Check theSystem Requirementsdocument for a list of Eclipse versions that are compatible with the Android SDK.

    • If Eclipse is already installed on your computer, make sure that it is a version that is compatible with ADT and the Android SDK.
    • If you need to install or update Eclipse, you can download it from this location:

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

      The "Eclipse Classic" version is recommended. Otherwise, a Java or RCP version of Eclipse is recommended.

    Additionally, before you can configure or use ADT, you must install the Android SDK starter package, as described inDownloading the SDK Starter Package. Specifically, you need to install a compatible version of the Android SDK Tools and at least one development platform. To simplify ADT setup, we recommend installing the Android SDK prior to installing ADT.

    When your Eclipse and Android SDK environments are ready, continue with the ADT installation as described in the steps below.

    Downloading the ADT Plugin

    Use the Update Manager feature of your Eclipse installation to install the latest revision of ADT on your development computer.<>

    Assuming that you have a compatible version of the Eclipse IDE installed, as described inPreparing for Installation, above, follow these steps to download the ADT plugin and install it in your Eclipse environment.

    1. Start Eclipse, then selectHelp>Install New Software....
    2. ClickAdd, in the top-right corner.
    3. In the Add Repository dialog that appears, enter "ADT Plugin" for theNameand the following URL for theLocation:
      https://dl-ssl.google.com/android/eclipse/
    4. ClickOK

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

    5. In the Available Software dialog, select the checkbox next to Developer Tools and clickNext.
    6. In the next window, you'll see a list of the tools to be downloaded. ClickNext.
    7. Read and accept the license agreements, then clickFinish.

      Note: If you get a security warning saying that the authenticity or validity of the software can't be established, clickOK.

    8. When the installation completes, restart Eclipse.

    Configuring the ADT Plugin

    After you've successfully downloaded the ADT as described above, the next step is to modify your ADT preferences in Eclipse to point to the Android SDK directory:

    1. SelectWindow>Preferences...to open the Preferences panel (Mac OS X:Eclipse>Preferences).
    2. SelectAndroidfrom the left panel.

      You may see a dialog asking whether you want to send usage statistics to Google. If so, make your choice and clickProceed. You cannot continue with this procedure until you clickProceed.

    3. For theSDK Locationin the main panel, clickBrowse...and locate your downloaded SDK directory.
    4. ClickApply, thenOK.

    Done! If you haven't encountered any problems, then the installation is complete. If you're installing the Android SDK for the first time, return toInstalling the SDKto complete your setup.

    Troubleshooting ADT Installation

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

    • If Eclipse can not find the remote update site containing the ADT plugin, try changing the remote site URL to use http, rather than https. That is, set the Location for the remote site to:
      http://dl-ssl.google.com/android/eclipse/
    • If you are behind a firewall (such as a corporate firewall), make sure that you have properly configured your proxy settings in Eclipse. In Eclipse, you can configure proxy information from the main Eclipse menu inWindow(on Mac OS X,Eclipse) >Preferences>General>Network Connections.

    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 it:

    1. Download the current ADT Plugin zip file from the table below (do not unpack it).
      NamePackageSizeMD5 Checksum
      ADT 11.0.0ADT-11.0.0.zip5520455 bytes8f01ecf456f28a90ba3dcf89cfeb37dc
    2. Follow steps 1 and 2 in thedefault install instructions(above).
    3. In the Add Site dialog, clickArchive.
    4. Browse and select the downloaded zip file.
    5. Enter a name for the local update site (e.g., "Android Plugin") in the "Name" field.
    6. ClickOK.
    7. Follow the remaining procedures as listed fordefault installationabove, starting from step 4.

    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 topicADT 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:

    Anerror occurred during provisioning.
    Cannotconnect 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.

    Updating the ADT Plugin

    From time to time, a new revision of the ADT Plugin becomes available, with new features and bug fixes. Generally, when a new revision of ADT is available, you should update to it as soon as convenient.

    In some cases, a new revision of ADT will have a dependency on a specific revision of the Android SDK Tools. If such dependencies exist, you will need to update the SDK Tools component of the SDK after installing the new revision of ADT. To update the SDK Tools component, use the Android SDK and AVD Manager, as described inAdding SDK Components.

    To learn about new features of each ADT revision and also any dependencies on the SDK Tools, see the listings in theRevisionssection. To determine the version currently installed, open the Eclipse Installed Software window usingHelp>Software Updatesand refer to the version listed for "Android Development Tools".

    Follow the steps below to check whether an update is available and, if so, to install it.

    1. SelectHelp>Check for Updates.

      If there are no updates available, a dialog will say so and you're done.

    2. If there are updates available, select Android DDMS, Android Development Tools, and Android Hierarchy Viewer, then clickNext.
    3. In the Update Details dialog, clickNext.
    4. Read and accept the license agreement and then clickFinish. This will download and install the latest version of Android DDMS and Android Development Tools.
    5. Restart Eclipse.

    If you encounter problems during the update, remove the existing ADT plugin from Eclipse, then perform. a fresh installation, using the instructions forInstalling the ADT Plugin.


    TAG:

     

    评分:0

    我来说两句

    日历

    « 2024-04-06  
     123456
    78910111213
    14151617181920
    21222324252627
    282930    

    数据统计

    • 访问量: 66076
    • 日志数: 51
    • 建立时间: 2010-11-08
    • 更新时间: 2014-05-12

    RSS订阅

    Open Toolbar