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
Asked
Active
Viewed 5.5k times
8
-
Exact duplicate of http://stackoverflow.com/q/2959820/403455 – Jeff Axelrod Nov 18 '11 at 19:23
2 Answers
11
First Way
- Install ADT plugin
- Right click on java project
- Select Android > Convert to Android project.
- 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:
- Check in your java project into a VCS (svn or git or whatever)
- Delete it from workspace
- Import the project from VCS
- On import, select Create New Project -> Android
Third Way
Why not just copy sources to a newly created Android project :) ?
Fourth Way: UDP :)
- Remove the java project from workspace
- Start create new Android project wizard
- Select create from existing source option and point to your java project folder.

prolink007
- 33,872
- 24
- 117
- 185

Konstantin Burov
- 68,980
- 16
- 115
- 93
-
1The first way no longer works. The second way also does not seem to work anymore. The fourth way also does not seem to work. With the fourth way, you must have an android manifest there for it to work. – prolink007 Mar 26 '12 at 15:36
-
1There is no longer an 'Android' context menu option for 'Project'. There is only 'Android Tools', and NO 'Convert to Android project' option! – IgorGanapolsky Sep 27 '12 at 15:27
-
I have a java project and now I want to convert it to Android application. There are two native libraries being used in my java app aswell. so which solution I should opt for? – farzin parsa Apr 02 '14 at 22:05
-