I’ve been developing on Android for the past two months, I have learned a few things, but I think it’s time to start doing it right, so I’m trying to implement the MVP / MVC pattern, which in this case is the most suitable patterns for processing the user interface.
I read a lot of threads and examples, but I still have some doubts, very likely due to my lack of experience with Android.
Some authors define actions as presenters / controllers, and some others as perceptions that I believe that actions should work as presenters, not views, for its natural ability to save state and present layout to the user, maybe I'm wrong, and I hope someone can clarify this.
If I'm right, then the views should be different classes that use the layout and bind events to communicate with the host (activity), this is where I get lost ...
I could not find a way to correctly create a class that extends from the view, and uses the layout to bind events and the ability to communicate with the host. The only way I did this is to use the Builder object, the creator creates the view through the inflatable element and binds the events. This works, but the view does not implement an interface that destroys my MVP pattern.
Another way I'm thinking of is using View as Proxies for the android view object, but I'm not sure if this is the best way to handle this ...
I would really appreciate it if someone could point me in the right direction.
Thank you and sorry for the long post!
source share