views:

79

answers:

1

Hello.

Im starting my first Android project so im still kind of n00b and not sure about how to organize some things to have a clean code :P

I have my first screen with a spinner and a button. When you click the button i catch the spinner selection and the app will move to a new screen (Depending on the spinner selection).

So now, i have 2 more .xml for the layout of the new screens, but i dont know if i must continue coding in the same Activitie/.java file, or if i should make a new Activitie and in that case, if i should create this new Activitie into another .java file os stay using the same..

Im not sure if i explained myself right xD. Anyway, if anyone need more info, just tell me and i will try to make it better :)

Thanks!

+2  A: 

Check this question and the answer: http://stackoverflow.com/questions/3320534/android-application-architecture-what-is-the-suggested-model

Answering to your specific question,

1- Create an Activity for each screen. It's simple: new screen = new activity

2- Use an individual file for each Activity. Easier to mantain, easier to read, better structure and easier to distribute in packages. Follow this rule not only in android but almost any software project.

Maragues
Thank you man, i'll follow that simple rule and i'll check a little about the MVC :)
Kitinz