0

I have an existing git repository of pure Java code that I would like to add to my Android project.

I don't want to change any of the existing files. I want to keep my existing package names to simplify the maintenance of my legacy code.

In Eclipse, you can simply add the root of the existing project to your Java Build Path.

How to do the same in Android Studio?

enter image description here

djondal
  • 2,521
  • 3
  • 24
  • 40

2 Answers2

0

I'm not sure this will help or not. But you may check these.

https://developer.android.com/sdk/installing/migrate.html

Unable to import Eclipse project to Android Studio

How to import eclipse project from git to Android Studio?

Community
  • 1
  • 1
Shihab
  • 2,641
  • 3
  • 21
  • 29
  • Hi, I am not actually looking at importing an Eclipse project, but a set of Java source files into an Android Studio project. – djondal Apr 13 '15 at 23:28
0

My solution to this was to Export my Java project to a JAR.

And then, I added the JAR to the Android Studio project. File > Project Structure leads to this window: enter image description here

That way, I could use my files untouched as such.

I am not so happy with this solution because it breaks my revision control system.

djondal
  • 2,521
  • 3
  • 24
  • 40
  • Where you able to find a solution of adding the Eclipse project to the AS project rather than importing it ? – c0der Nov 12 '16 at 08:39