diff --git a/docs/html/images/tools/eclipse-notepad-pre-import--structure.png b/docs/html/images/tools/eclipse-notepad-pre-import--structure.png new file mode 100644 index 0000000000000..b9c38146e8edd Binary files /dev/null and b/docs/html/images/tools/eclipse-notepad-pre-import--structure.png differ diff --git a/docs/html/images/tools/studio-import-destination-dir.png b/docs/html/images/tools/studio-import-destination-dir.png new file mode 100644 index 0000000000000..d1c6c70c8d2c8 Binary files /dev/null and b/docs/html/images/tools/studio-import-destination-dir.png differ diff --git a/docs/html/images/tools/studio-import-options.png b/docs/html/images/tools/studio-import-options.png new file mode 100644 index 0000000000000..f14eca006ed8a Binary files /dev/null and b/docs/html/images/tools/studio-import-options.png differ diff --git a/docs/html/images/tools/studio-import-project-structure-android.png b/docs/html/images/tools/studio-import-project-structure-android.png new file mode 100644 index 0000000000000..4cd71862a899a Binary files /dev/null and b/docs/html/images/tools/studio-import-project-structure-android.png differ diff --git a/docs/html/images/tools/studio-import-project-structure-project.png b/docs/html/images/tools/studio-import-project-structure-project.png new file mode 100644 index 0000000000000..c7ffda89ca78d Binary files /dev/null and b/docs/html/images/tools/studio-import-project-structure-project.png differ diff --git a/docs/html/images/tools/studio-import-summary.png b/docs/html/images/tools/studio-import-summary.png new file mode 100644 index 0000000000000..a85e339340cd9 Binary files /dev/null and b/docs/html/images/tools/studio-import-summary.png differ diff --git a/docs/html/images/tools/studio-select-project-forimport.png b/docs/html/images/tools/studio-select-project-forimport.png new file mode 100644 index 0000000000000..c6a3599a0a7ff Binary files /dev/null and b/docs/html/images/tools/studio-select-project-forimport.png differ diff --git a/docs/html/sdk/installing/migrate.jd b/docs/html/sdk/installing/migrate.jd index 345e89a7e9d34..d982939510c9a 100644 --- a/docs/html/sdk/installing/migrate.jd +++ b/docs/html/sdk/installing/migrate.jd @@ -4,53 +4,264 @@ page.title=Migrating to Android Studio
+ + +

In this document

+
    +
  1. Migration Overview
  2. +
  3. Migration Prerequisites
  4. +
  5. Importing Projects to Android Studio
  6. +
  7. Validating imported projects
  8. +
+ +

See also

-

If you have been using Eclipse with ADT, be aware -that Android Studio is now the official IDE for -Android, so you should migrate to Android Studio to receive all the latest IDE updates.

+

Migrating from Eclipse ADT to Android Studio requires adapting to a new project structure, +build system, and IDE functionality. To simplify the migration process, Android Studio provides an +import tool so you can quickly transition your Eclipse ADT workspaces and Ant build scripts to +Android Studio projects and Gradle-based build files.

-

To migrate existing Android projects, simply import them using Android Studio:

+

This document provides an overview of the migration process and walks you +through a sample import procedure. For more information about Android Studio features and the +Gradle-based build system, see Android Studio Overview +and Configuring Gradle Builds.

+ + + +

Migration Overview

+

Migrating from Eclipse to Android Studio requires that you change the structure of your +development projects, move to a new build system, and use a new user interface. Here are some of +the key changes you should be aware of as you prepare to migrate to Android Studio:

+ + + + + +

Migration Prerequisites

+

Before migrating your Eclipse ADT app to Android Studio, review the following steps to make +sure your project is ready for conversion, and verify you have the tool configuration you need in +Android Studio:

+ + + + + +

Importing Projects to Android Studio

+

Android Studio provides a function for importing Eclipse ADT projects, which creates a new +Android Studio project and app modules based on your current +Eclipse ADT workspace and projects. No changes are made to your Eclipse project files. The Eclipse +ADT workspace becomes a new Android Studio project, and each Eclipse ADT project within the workspace +becomes a new Android Studio module. Each instance of Android Studio contains a project with one or +more app modules.

+ +

After selecting an Eclipse ADT project to import, Android Studio creates the Android +Studio project structure and app modules, generates the new Gradle-based build files and settings, +and configures the required dependencies. The import options also allow you to enter your workspace +directory and any actual path maps to handle any unresolved relative paths, path variables, and +linked resource references.

+ +

Depending on the structure of your Eclipse ADT development project, you should select specific +files for importing:

+ + +

To import a project to Android Studio:

    -
  1. In Android Studio, from the main menu or the Welcome to Android Studio page, - choose File > Import Project.
  2. -
  3. Select the Eclipse root project directory and click OK. -

    Note: The Eclipse root directory must contain the - AndroidManifest.xml file. Also, the root directory must contain either the - .project and .classpath files from Eclipse or the - res/ and src/ directories.

    -
  4. -
  5. Follow the steps in the import wizard.
  6. +
  7. Start Android Studio and close any open Android Studio projects.
  8. +
  9. From the Android Studio menu select File > New > Import Project. +

    Alternatively, from the Welcome screen, select Import project + (Eclipse ADT, Gradle, etc.).

  10. +
  11. Select the Eclipse ADT project folder with the AndroidManifest.xml file + and click Ok. +

    +
  12. +
  13. Select the destination folder and click Next. +

  14. +
  15. Select the import options and click Finish. +

    The import process prompts to migrate any library and project dependencies to Android Studio, + and add the dependency declarations to the build.gradle file. The import process + also replaces any well-known source libraries, binary libraries, and JAR files that have known + Maven coordinates with Maven dependencies, so you no longer need to maintain these dependencies + manually. The import options also allow you to enter your workspace directory and any actual + path maps to handle any unresolved relative paths, path variables, and linked resource + references.

    +

  16. + +
  17. Android Studio imports the app and displays the project import summary. Review the summary + for details about the project restructuring and the import process. +

    +
-

Android Studio imports the current dependencies, downloads libraries, and -creates an Android Studio project with the imported Eclipse project as the main module. Android -Studio also creates the required Gradle build files.

- -

The import process replaces any JAR files and libraries with Gradle dependencies, and replaces -source libraries and binary libraries with Maven dependencies, so you no longer need to maintain -these files manually.

- -

Note: If there are references to Eclipse workspace library files, - comment them out in the project.properties or .classpath files - that you imported from the Eclipse project. You can then add these files in the - build.gradle file. See - Configuring Gradle Builds.

+

After importing the project from Eclipse ADT to the new Android Studio project and module +structure, each app module folder in Android Studio contains the complete source set for that +module, including the {@code src/main} and {@code src/androidTest} directories, resources, build +file, and Android manifest. Before starting app development, you should resolve any issues shown in +the project import summary to make sure the project re-structuring and import process completed +properly.

-

For more help getting started with Android Studio and the IntelliJ user experience, -learn more about Android Studio and -read FAQ on Migrating to IntelliJ IDEA.

+ +

Validating imported projects

+

After completing the import process, use the Android Studio Build and +Run menu options to build your project and verify the output. If your project +is not building properly, check the following settings:

+ +