In this thread both project structures were already compared. The question that is still open for me is if there is something that won't work or any disadvantages or staying with the old eclipse project structure after migrating to Android Studio? We have migrated a really big project to Android Studio staying with the old structure and all works fine, changing the structure of such a big project would be really complicated, are there any advantages with doing so?
Asked
Active
Viewed 47 times
1 Answers
0
You can stay with old Eclipse project structure. All you has to do is set up correct path to your code in build.gradle config file:
android {
...
sourceSets {
main {
manifes.srcFile 'path/to/AndroidManifest.xml'
java.srcDirs = ['path/to/src']
resources.srcDirs = ...
aidl.srcDirs = ...
res.srcDirs = ...
assets.srcDirs = ...
jni.srcDirs = ...
}
androidTest {
java.srcDirs = ['path/to/android/tests']
res.srcDirs = ...
...
}
test {
java.srcDirs = ['path/to/unit/tests']
}
}
}
Only thing that may be confusing that if you are using proxy and configure it in AndroidStudio, it will inject parameters as plain text in your root gradle.properties file. If you are using gradle.properties, i.e. you are inject variables from Jenkins, it can be frustrating, and also you can suddenly commit this file with all your credentials. To avoid it, you can use project structure with modules:
/root
-build.gradle
-gradle.properties
-module/
-module/build.gradle
-module/gradle.properties
In this case, you can hold your gradle variables in module/gradle.properties, and root gradle.properties will be used for AndroidStudio purposes.

noktigula
- 425
- 6
- 15