Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How do I open my existing Eclipse projects in Android Studio?

Switching to Android Studio with all my existing projects in Eclipse. So what is the procedure to do that.

like image 787
bCliks Avatar asked May 16 '13 09:05

bCliks


People also ask

Where can I find my projects in Android Studio?

Android Studio stores the projects by default in the home folder of the user under AndroidStudioProjects. The main directory contains configuration files for Android Studio and the Gradle build files. The application relevant files are contained in the app folder.

Can I use Eclipse with Android Studio?

There is no need to add a plugin to Android Studio but if we use Eclipse then we do need to. Eclipse needs many resources to start but Android Studio does not. Android Studio is based on IntelliJ's Idea Java IDE and Eclipse uses the ADT Plugin to develop Android applications.

How do I import library to Android?

To use your Android library's code in another app module, proceed as follows: Navigate to File > Project Structure > Dependencies. In the Declared Dependencies tab, click and select Library Dependency in the dropdown. In the Add Library Dependency dialog, use the search box to find the library to add.

Which Android Studio wizard button will you use to an existing project?

Answer. Answer: 2. Import project (Eclipse ADT , Grade , etc.)


4 Answers

Export from Eclipse

1.Update your Eclipse ADT Plugin (you must have version 22.0 or higher).

2.In Eclipse, select File > Export.

3.In the window that appears, open Android and select Generate Gradle build files.

4.Select the projects you want to export for Android Studio and click Finish.

Your selected projects remain in the same location but now contain a build.gradle file and are ready for Android Studio.

Import into Android Studio

1.In Android Studio, select File > Import Project.

2.Locate a project you exported from Eclipse, select the project's root directory and click OK.

3.Select Create project from existing sources and click Next.

4.Follow the walk-through to complete the import process.

for more info clickhere

some FAQ Eclipse Migration FAQ

Migrating to Android Studio

like image 90
bCliks Avatar answered Oct 02 '22 18:10

bCliks


The official release of Android Studio (version 1.0.2 at the time of this writing) now supports importing ADT projects directly. In fact, when trying to export from ADT, there is now a popup that suggests importing directly from Android Studio is a better choice.

Just open Android Studio > Import Non-Android Studio Projects > Select your ADT project folder.

It creates a new AS-version of your project, and reports items that need your manual verification.

like image 20
Ryuu Avatar answered Oct 02 '22 19:10

Ryuu


Try these steps for importing an Eclipse project into Android studio:

1- Click on import project (Eclipse ADT, Gradle, etc.).

enter image description here

2- Choose the root folder of your project. The folder that contains bin folder.

enter image description here

3- Choose where you want to import it and click next.

enter image description here

4- Click on finish.

enter image description here enter image description here

5- Change the view to project.

enter image description here

6- Open build.gradle in your src folder.

enter image description here

7- You should find out your current SDK version. So, click on tools-> Android-> SDK Manager-> Launch standalone SDK Manager and scroll to the bottom.

enter image description here enter image description here

8- Change your build.gradle based on your SDK version and click try again. For example, mine is 23.1.1.

enter image description here enter image description here

If you have any library that is not added automatically please visit https://stackoverflow.com/a/35369267/5475941 to add it manually.I hope it helps.

enter image description here

like image 26
Mohammad Avatar answered Oct 02 '22 18:10

Mohammad


Forget the import, just hand build it.

After trying and failing to import the project I did the following hand-import. I gained trust that the export / import procedure didn't leave behind any problems and I gained knowledge of the new build system:

  1. In Android studio create a new blank project
  2. Build it out to device to trust that it is working
  3. Slowly a bit at a time add in your previous code, leaving behind anything specific to the old build system

It is a slow process but the debugging is much more focused on your actual code rather than trying to figure out "what the import actually did".

like image 26
ooolala Avatar answered Oct 02 '22 18:10

ooolala