It\'s possible to add pure Java module to existing Android project.
But is it possible to create pure Java project with no Android dependencies?
Easiest method is to temporarily disable the Android Support Plugin. Un-check Configuration > Plugin > Android Support Plugin After restarting close any current project and you will get the new project wizard with all of your non-android options. Once your new project is created you can re-enable the Android plugin.
I think this is possible to create a new module from following path (Using Androdi Stdio 1.1.0):
File> New Module> Choose from more module> java library
Hope it will work's for you.
No you cannot create a java
project with Android Studio
because AS's building system won't let you build your project once you are done writing your application. Android Studio's gradle
building system only builds .apk
file.
Android Studio won't support most things requiring an external database or application server.
One thing that you might want to add here to help REALLY new folks out (it kept tripping me up) is that after creating the folder hierarchy for your Java code (src/main/java) you must right click the java folder and select Mark Directory As > Sources Root. Otherwise, you won't have the option of creating a new java class within the foo directory.
The answer by Aleksander worked for me. Thanks Aleksander. I further needed to create a package and add a new java class to it before Step 5. Then in Step 6, I used that java class as the MainClass.
Yes, it is possible. You have to manually create all necessary files.
Here are steps for Gradle based project:
Select Edit Configuration from drop down menu where normally you start project
Click Add new Configuration and select Application
Android studio is more or less like IntelliJ Community Edition.
apply plugin: 'java'
sourceCompatibility = 1.8
version = '1.0'
repositories {
mavenCentral()
}
dependencies {
testCompile group: 'junit', name: 'junit', version: '4.11'
}