In my android studio project want to use existing java project code
I tried this way:
Click File > New Module. Select Java Library and click Next.
On Android Studio 2.3.3
File -> New -> Import Project
A simple google search gives you everything: https://www.google.co.za/search?q=import%20project%20to%20android%20studio
To import a project to Android Studio:
- Start Android Studio and close any open Android Studio projects.
- From the Android Studio menu select File > New > Import Project. ...
- Select the Eclipse ADT project folder with the AndroidManifest.xml file and click Ok.
- Select the destination folder and click Next.
Google has made this tutorial: https://developer.android.com/sdk/installing/migrate.html
I have had issues before with this so I normally just create a new project and just copy all the classes, drawables, etc from the old project into the new project.
It is not possible to access with out gradle file,
you can use these steps if your Java project in eclipse
1.Right Click on project select export a new window appears
2.Select generate gradle build file then the select project click finish
It will create your project with gradle file,then you can easily import
File -> New -> Import module.....
The following link can be referred to:
https://developer.android.com/studio/intro/migrate.html
Import Eclipse Projects to Android Studio
Import as a Project:
Start Android Studio and close any open Android Studio projects.
From the Android Studio menu click File > New > Import Project. Alternatively, from the Welcome screen, click Import project (Eclipse ADT, Gradle, etc) Select the Eclipse ADT project folder with the AndroidManifest.xml file and click Ok. Select the destination folder and click Next Select the import options and click Finish.
Importing a Gradle-based IntelliJ project
If you are already using Gradle with your IntelliJ project, you can open it in Android Studio using the following steps:
Click File > New > Import Project. Select your IntelliJ project directory, and click OK. Your project will open in Android Studio.
Easiest way to do this is to choose the 'open an existing project' option, find your project, and then find the 'app' folder. Click on this to highlight it and then click 'Ok'. This will then import your complete project
You can import a java project if it is a Gradle build project. Otherwise android studio not allow to import other java projects.
File >> New >> Import Project and select the Gradle build java project
Thanks