Ryan Mills
Ryan Mills

Reputation: 959

Android development, Source file organization/notation best practices?

Android lists coding standards but does not seem to go into how source (Activity's, etc) files should be organized. As my project grows im wondering how I should be breaking up the classes or if I just just leave a mess of 20 files in the src folder. It does not seem like there is any sort of notation (like Hungarian) nor an way to id whats an activity, or other helper class. Are there any docs on these sorts of best practices?

Upvotes: 5

Views: 1211

Answers (3)

Haphazard
Haphazard

Reputation: 10948

Do you really have everything in your base src folder? A good start would be to put your classes into packages. After that, you could create a "util" package for your helper classes and name them as such (ie. MainActivityUitl.java).

Upvotes: 0

pumpkee
pumpkee

Reputation: 3357

If you look at the apps that come with the android source, like gallery, launcher ect. you will notice that those guys pretty much kept everything in one folder... Quite a mess if you ask me. I usually have a folder "widget" for all my views, one for activities, one for providers one for utilities whatever.

Browsing throug open source projects alot, i dont think there is any common standart for doing this. Use what works best for you.

Upvotes: 2

Vicente Plata
Vicente Plata

Reputation: 3380

We already had a little discussion about it here:

Android separate packages

Besides that, I think following the (pure) Java coding standards is a good practice.

Upvotes: 0

Related Questions