Migrating to Android Studio

See also

  • IntelliJ FAQ on migrating to IntelliJ IDEA
  • Eclipse Compatibility Mode
  • FAQ on Migrating

If you have been usingEclipse with ADT, be aware thatAndroid Studiois now the official IDE for Android, so you should migrate to Android Studio to receive all the latest IDE updates.

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

  1. In Android Studio, from the main menu or theWelcome to Android Studiopage, chooseFile > Import Project.
  2. Select the Eclipse root project directory and clickOK.

    Note:The Eclipse root directory must contain theAndroidManifest.xmlfile. Also, the root directory must contain either the.projectand.classpathfiles from Eclipse or theres/andsrc/directories.

  3. Follow the steps in the import wizard.

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 theproject.propertiesor.classpathfiles that you imported from the Eclipse project. You can then add these files in thebuild.gradlefile. SeeConfiguring Gradle Builds.

For more help getting started with Android Studio and the IntelliJ user experience,learn more about Android Studioand readFAQ on Migrating to IntelliJ IDEA

假如你以前是用Eclipse进行开发,想迁移到Android Studio上。你需要导出你的工程,导出的目的是为了生成Gradle文件。然后将导出的工程导入Android Studio即可。

  • 从Eclipse导出

1、更新你的Eclipcs的ADT插件(ADT的版本必须大于等于22.0)

2、在Eclipse中,选择Flie->Export

3、弹出的对话框中,点击Android并选择Generate Gradle build files

4、选择你要导出的工程后点击Finish

你选择导出的工程依旧在原来的路径下,只是多了一个为Android Studio准备的build.gradle文件

  • 导入到Android Studio中

1、在Android Studio中,关闭你当前的工程。页面会跳到欢迎页面。

2、选择Import Project

3、定位到你想要导入的工程的目录,选择build.gradle文件

4、在弹出来的对话框中,不进行任何更改直接点OK

这时你的工程就被导入到Android Studio中了。

注意:即使工程没有生成build.gradle文件,你也可以导入到Android Studio中。Android Studio也可以使用Ant来进行编译工程。然后,为了更好的使用其他的功能(如:build variants),我们强烈建议你使用ADT插件生成一个gradle文件或者在Android Studio中直接写gradle文件。更多的内容,可以戳这:http://tools.android.com/tech-docs/new-build-system/user-guide。

原文地址:http://developer.android.com/sdk/installing/migrate.html

更多相关文章

  1. [Android] HttpURLConnection or Apache Http client
  2. eclipse导入已有的android工程出错
  3. Android实现图片帮助跳转以及选择重拍Sqlite本地保存
  4. [原创] Android(安卓)SDK 安装全记录
  5. Android(安卓)Windows开发环境搭建
  6. 第一个android程序以及遇到问题解决办法
  7. Android的NDK开发(2)————利用Android(安卓)NDK编写一个简单
  8. Android(安卓)图片选择器
  9. wifi 通知栏上 选择程序时出现你的应用

随机推荐

  1. Google I/O 2014 New
  2. Android Binder机制(一) Binder的设计和
  3. ffmpeg neon优化必看!!android下编译ffmpeg
  4. android 设置LinearLayout,RelativeLayou
  5. android获取/更改gps和WIFI状态
  6. android 系统开发 学习方向
  7. Android开发中Menu的理解
  8. Android 帧动画 AnimationDrawable 导致
  9. android4.0鼠标
  10. android使用SVG