I am not an Android developer, although Ive developed an application consisting of more than 50 actions, which makes the application really big. After 8 weeks of development, now there are problems that make the application difficult to maintain and update. The main ones I'm dealing with are
I cannot pass an object reference for action constructors. In fact, I found that the mechanisms startActivityForResult - Intent - onActivityResult really restrict and lead to a dirty code of many constants for actions for activity and a lot of switch case , which are really difficult to track the flow of the application.
Another problem is that I do not know how to manage the life cycle of the entire application, since each type of activity has its own life cycle.
I have had successful experience with LWUIT and J2ME - polish , which ignore J2ME MIDlets (similar to android activity) and implement their own architecture and window system with one midlet as an input to the application. Ive come up with the same idea for Android.
To clarify, Im is thinking of an application with only one main Activity and other actions implemented as objects that extend the View object, and these views can be dynamically added to the main FrameLayout activity and stacked on top of each other. The logic of actions can be implemented in such classes, and I even found a way to implement dialogs in this way. Business and state objects can be passed on to their constructor, and that sounds good, ignoring its side effect of writing a bit more code. In this way, listeners can also be passed on to view designers, which simplify customization of the user interface and flow control.
But there are questions:
- Is this a good practice?
- Wouldn't that lead me to performance or memory issues?
I also know
None of these issues explicitly address issues related to effectiveness or practice, with substantiated evidence or a documented link.
Please help me with this.
anonim
source share