在子文件夹(Eclipse)中组织Android src文件夹

时间:2023-01-15 21:36:37

Sorry for the noob question but I am pretty new to the Android SDK/Eclipse environment

对于noob的问题我很抱歉,但是我对Android SDK/Eclipse环境很陌生

The application I am developing is getting pretty big with several classes. I would like to organize it better, having folders for views, models, dialogs ect...

我正在开发的应用程序在几个类中变得相当大。我想把它组织得更好,有视图、模型、对话框等文件夹。

How can I create a subfolder of the src folder? If I right click on the src folder I do not have that option...Should I create a new package?

如何创建src文件夹的子文件夹?如果我右键单击src文件夹,我没有这个选项……我应该创建一个新的包吗?

I tried to add a new src folders, but that goes to the same level of the main src folder with "default package" path and Eclipse does not see my files there...

我尝试添加一个新的src文件夹,但是它会进入到主src文件夹的相同级别,带有“默认包”路径,而Eclipse在那里看不到我的文件……

What is the best way to have a folder structure for all my classes in a project?

在一个项目中,为我的所有类创建文件夹结构的最佳方式是什么?

Thanks

谢谢

4 个解决方案

#1


6  

right click to folder, select new package

右键单击文件夹,选择new package

#2


5  

right click on the src folder => New => Package => rename your package for example to :

右键点击src文件夹=> New => Package =>将你的包重命名为:

com.yourapplication.model
com.yourapplication.view
com.yourapplication.utils
com.yourapplication.adapters

etc

#3


2  

Its because your using package explorer. Switch to Navigator (window-->show view ---> other -------> Navigator)

因为您使用的是package explorer。切换到Navigator(窗口—>显示视图—>其他——>导航)

now you can see the project as folders instead of packages.

现在您可以将项目看作文件夹而不是包。

#4


1  

You must
Right click on "youfolder" -> "Build path" -> "add to build path" or "user as source folder"

您必须右击“youfolder”—>“Build path”—>“add to Build path”或“user as source folder”

#1


6  

right click to folder, select new package

右键单击文件夹,选择new package

#2


5  

right click on the src folder => New => Package => rename your package for example to :

右键点击src文件夹=> New => Package =>将你的包重命名为:

com.yourapplication.model
com.yourapplication.view
com.yourapplication.utils
com.yourapplication.adapters

etc

#3


2  

Its because your using package explorer. Switch to Navigator (window-->show view ---> other -------> Navigator)

因为您使用的是package explorer。切换到Navigator(窗口—>显示视图—>其他——>导航)

now you can see the project as folders instead of packages.

现在您可以将项目看作文件夹而不是包。

#4


1  

You must
Right click on "youfolder" -> "Build path" -> "add to build path" or "user as source folder"

您必须右击“youfolder”—>“Build path”—>“add to Build path”或“user as source folder”