Do all .java files load when the app is opened?
I'm just starting into Java/Android apps... I've got a few sample things up and running... but I want to organize my code in a proper manner. Are all .java files loaded when the app is opened, or do I need to tell it to load other .java fil开发者_StackOverflow社区es within my code...
Well what do you mean by "loaded"? The .java files are compiled to .dex files when you create your .apk, so no they don't need to be "loaded".
If you're talking about importing in order to use classes in other .java files, then not usually. You only need to use import
for classes in other packages.
There won't bee any .java files in your Android application.
The .java files will be compiled to .class files which in turn will be compiled into a single .dex file which then will be added to the .apx file.
Sounds complicated but the build system will take care of it all. And since there is only one .dex file the whole application is loaded in one piece.
精彩评论