How to import existing projects from another folder to workspace in android studio

I want to import an existing Android project into my workspace using Android Studio. I tried using a generic method like File-> Import Project-> Selected Folder , but the problem I am having is that the project is being imported into the same existing project, whereas in eclipse I will have a checkbox stating that Copy projects to work area (so I can easily copy my projects by checking the box in my work area). Since I am new to android studio, I was unable to trigger hidden functions to import and copy projects to the workspace. Please help me with your valuable answers.

Note: I am currently copying a file from somewhere else to my workspace and then importing the project into android studio. But it gets tedious when processing multiple projects at the same time

+3


source to share


3 answers


As usual import projects into desired Android Studio workspace.

Android Studio 1.0.2



File ---> Import Project ---> (your current project folder) ---> Import Destination Directory (your workspace location) ---> Done

+2


source


I have the same problem.

Once this happens, if you have a complete AndroidStudio / gradle project and want to import it into Android Studio, just copy (or move, whichever is faster) the entire folder in the workspace, and then use File -> Open , not File -> Importing a project .

It seems like it's the same for the IDE, I can "import" and build the project flawlessly, but of course "import" is faster (I don't know why it works this way).



EDIT:

After taking a close look at the "open project" structure, I think Android Studio is doing something strange. I copied the project from directory A to directory B, and I open the project in directory B, but some of the files still point to directory A.

I repeated copying the project in directory B and then importing the project from B instead of opening; now the links seem to be correct.

+1


source


If you are trying to import an entire project into a workspace by creating a new app from existing code, it is very easy if the project you are importing is already in your workspace folder or there is no conflicting project in your workspace with the same name.

On the other hand, if you have a project in the workspace that you are working on and want to import other projects into it, then it gets tricky, especially if you don't have well-defined working sets. I suggest you:

  • Open specific folders of the project you want to import, for example the "src" folder, and copy the java files into it directly into your project on your eclipse (if you are using it).
  • Right click the src file on your eclipse and paste the java files. This will save you time changing the package name in java files.
  • Do the same for the resource files by copying them from the corresponding files to the corresponding files in your project.
  • Then when you do, remember to edit the manifest file with the new changes to the actions you imported. To do this, you need to look into the manifest of the project you imported so you don't miss a point.

This may sound scary and cumbersome, but it will help you know what exactly you imported. But you will need to change the package names in java files to the current package name.

0


source







All Articles