Reputation: 5759
I have a large UI (about 20-25 screens). How should I organize my code? Should I separate by functionality into different packages? Should I have one package for all UI classes and then create sub packages to organize? Or should I not create separate packages and organize into folders. Any help would be greatly appreciated.
Upvotes: 3
Views: 2657
Reputation: 14711
I've tried to separate my classes in logical packages as much as possible.
I think its easy to maintain and reuse code organized this way
I also use naming conventions so I know what a class or a file is about at a glance
in the layouts folder:
activity_login.xml
activity_register.xml
dialog_delete_profile_confirmation.xml
in the drawable folder:
icon_feed.xml
icon_search.xml
images_loading_splash_screen.png
images_default_avatar.png
in the asynctasks package
GetUserDataFromServerAsync.class
RegisterUserAsync.class
(so that when I refer these in the code I know its not the internal handler class, but the class that communicates with the server)
Upvotes: 1
Reputation: 3380
When you create a folder, it becomes a package. My favourite structure for large projects is as follows:
Hope this helps.
Upvotes: 8