Migrating From Eclipse Projects

To migrate an Eclipse project to an Android Studio project, you have two options:
  • Importing the Eclipse project directly into Studio. This is the preferred approach, and has numerous advantages:
    • It will detect many source libraries (such as ActionBarSherlock) and binary libraries (e.g. guava.jar), and will replace these with maven dependencies instead, which means you no longer have to maintain the libraries manually
    • It will rewrite the project using the new canonical Android Gradle project structure, which supports instrumentation tests in the same project as the tested code, flavor and build type specific resources, etc
  • Exporting the Eclipse project from Eclipse as a Gradle project.This mechanism is not as flexible (or frequently updated) as the direct Gradle import, but it has two usages:
    • It will let you keep your Gradle project using the same file structure as Eclipse ADT projects (in other words, it does not move files around; everything is kept in place, and a special build.gradle file tells Gradle to look for sources in the old directory structure rather than the new one). This is useful if you want to continue working with both Studio and Eclipse on the same codebase.
    • If your project is doing a lot of Eclipse-specific directory mappings (with path variables, linked resources etc) it's possible that the Android Studio importer can not resolve the paths properly; in that case, try the Eclipse exporter (but please also file a bug so we can fix the importer).

Importing Directly into Android Studio

To import into Android Studio, select File > Import, and then select the directory containing your Eclipse ADT project. A wizard will open and guide you through the rest of the import process. When the project import has finished, it will open up a file called "import-summary.txt" which lists all the steps taken during import and suggestions for next steps. For example, it may note files that were not migrated, it may note missing components in your SDK install, and so on.

Exporting from Eclipse

Open the project in Eclipse, and from there, exportthe project. NOTE: Make sure you are using the latest possible version of Eclipsesince we have fixed issues related to export recently.


Choose the Gradle option:
Proceed through the wizard. When you are done, you can import the build.gradle file into Android Studio.
For more information on customizing your build once you have the basics set up, see the new build system user guide. For additional information, see the build system overview page.

更多相关文章

  1. 代码中设置drawableleft
  2. android 3.0 隐藏 系统标题栏
  3. Android开发中activity切换动画的实现
  4. Android(安卓)学习 笔记_05. 文件下载
  5. Android中直播视频技术探究之—摄像头Camera视频源数据采集解析
  6. 技术博客汇总
  7. android 2.3 wifi (一)
  8. AndRoid Notification的清空和修改
  9. Android中的Chronometer

随机推荐

  1. Android Audio代码分析12 - stream type
  2. 把ndk作为独立编译器
  3. Android 实现底部菜单栏
  4. android学习之开机启动
  5. android 高效显示Bitmap - 开发文档翻译
  6. Android(安卓)vitualBox
  7. android超链接
  8. android 设置开机启动
  9. android 控件onClick事件的4种实现方式
  10. onInterceptTouchEvent和onTouchEvent调