Started working on my first project using Android Studio instead of Eclipse ADT. I would like to add sub folders to contain java.classes in order to structu
IntelliJIdea mixes packages and directories.
So, right click on the java folder, click new - 'Package', then add your directory.
Try this path : src/main/java/[MyCompany]/[myAppName]/...
src/main/java/
is default source directory in Android Studio
OR
if you don't want to change your directory structure.
you have to modify your build.gradle
to change source directory.
something like: (this example is for ADT project)
android {
...
sourceSets {
main {
manifest.srcFile 'AndroidManifest.xml'
java.srcDirs = ['src']
resources.srcDirs = ['src']
aidl.srcDirs = ['src']
renderscript.srcDirs = ['src']
res.srcDirs = ['res']
assets.srcDirs = ['assets']
}
}
...
}
In my case I wanted a mock package with java folder: