Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Organize Android src folder in subfolders (Eclipse)

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

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?

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...

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

Thanks

like image 239
Mirko Avatar asked Oct 11 '12 09:10

Mirko


3 Answers

right click to folder, select new package

like image 110
Nam Vu Avatar answered Oct 06 '22 12:10

Nam Vu


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

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

etc

like image 31
Houcine Avatar answered Oct 06 '22 11:10

Houcine


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

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

like image 21
j2emanue Avatar answered Oct 06 '22 10:10

j2emanue