I'm wondering what some good ways of organizing Android projects are. I'm building a little recipe application and have already made dozens of layouts, drawable resources, menus, etc., not to mention Java source code.

Android does not allow sub-folders for resources, so is there a way to organize them? Right now I'm trying to organize them through naming conventions (e.g. new_list_ingredient_edit) but I'm wondering if there is a better way, as the names will probably get pretty long and cumbersome.

Same thing with resources such as string values. As I understand it, I can create multiple resource files (e.g. strings_new_ingredient.xml, drawables_new_instructions.xml, etc.) but all my resources across files have still have to have unique names, which again is cumbersome.

I normally try to use heirarchy in my naming. If it is a layout for dialog, i will start with dialog_sharing or something like that.

As for graphics, I will start with btn or bg or txt or ic_menu depending on what they are for. Other than that, you just get used to it as you dev more for Android.

Make sure you also have a support folder on your drive for your local resources. I mimic the android layout so i keep my graphics sorted in res/... on my local drive too. I keep the psd and graphic files there and then just copy the pngs to eclipse.

Hope this kinda of helps. There is no real standard but you will pick up a style.

Thanks for the answer. I'm not sure what you mean by a support folder...do you mean a backup of the application resources somewhere on the computer?
–
xiongtxAug 11 '11 at 19:20

Yeah, have the folder for the project and then another folder with the same name and '_support' in the name. There I mimic the res folder framework so keep all the graphics organizes because a good app has -ldpi, -mdpi, -hdpi, -xlarge, etc... Since the names should be the same for the resources so the app can use which ever it likes from which folder depending on the device, it is easier to sort them with folders.
–
trgragliaAug 12 '11 at 7:16

Specifically with respect to organizing drawable resources, I would advise choosing names that describe the drawables structurally, not functionally.

For example, if you have a gray circle shape resource that you are using as a placeholder for an image, I would avoid naming it *image_placeholder*. Instead, I would call it *gray_circle_1*.

My advice comes from having had the experience on multiple occasions of having given things names like *image_placeholder*, forgetting what they actually contained, and then rewriting the same exact thing in a separate resource file without realizing it.