I've watched many tutorials now about how to program for Android - I have even started to create some programs myself. However, I noticed my programs all look like procedural ones, while Java should be working with object orientation. I have been trying to fix this, but I've found a problem. The primary class of my program - the one that's executed at the start of the application (under com.testprogram.www for example) seems to be a mixture of screen and control layers at the same time.
On all tutorials I found, I see a visual object being recovered from the main.xml
view (for example, a button - this recovery indicates to me that this would be the 'control' layer for treatment) and just after this the object is registered to a listener of some sort (in this case OnClickListener
- this should be done in the screen, not in the control, right?).
Is this meant to be this way? This main class under the www package is what? The 'screen' layer or the 'control' one? Is this class the right place to do what I mentioned above? Is this done this way because the XML-based interface is unable to register Java listeners? Anyone knows a good place for me to go for references on how to OO for Android?