Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Convert java project into android project on Eclipse [duplicate]

I have seen a question about converting android to java project. Now I want to know about Converting Java project into Android Project. Is there any way? Thanks

like image 335
Karate_Dog Avatar asked Aug 24 '11 06:08

Karate_Dog


People also ask

How do I open an existing Java project in Android Studio?

Launch Android Studio, and click File > New > Import Project. Locate your project directory, click the build. gradle file you created above to select it, and then click OK to import your project.

Can I use Android Studio for Java projects?

Use Android Studio and Java to write Android appsYou write Android apps in the Java programming language using an IDE called Android Studio. Based on JetBrains' IntelliJ IDEA software, Android Studio is an IDE designed specifically for Android development.


2 Answers

First Way

  1. Install ADT plugin
  2. Right click on java project
  3. Select Android > Convert to Android project.
  4. Supply /res folder, /AndroidManifest.xml and /default.properties if needed.

Second Way: UPD

Actually, the "First Way" doesn't work with latest ADT plugin versions, for some reason google has removed the convert command. Another way would be:

  1. Check in your java project into a VCS (svn or git or whatever)
  2. Delete it from workspace
  3. Import the project from VCS
  4. On import, select Create New Project -> Android

Third Way

Why not just copy sources to a newly created Android project :) ?

Fourth Way: UDP :)

  1. Remove the java project from workspace
  2. Start create new Android project wizard
  3. Select create from existing source option and point to your java project folder.
like image 116
Konstantin Burov Avatar answered Oct 21 '22 12:10

Konstantin Burov


Check this,

http://developer.android.com/guide/developing/projects/projects-eclipse.html

Convert existing project into Android project in Eclipse?

like image 21
Randroid Avatar answered Oct 21 '22 11:10

Randroid