jeudi 26 mai 2016

Android design pattern to manage UI elements

The answer to this question would be a design-pattern, to be used in development of Android applications, that simplifies the way user interface elements are managed such that many such elements can be managed centrally even though acted upon from various places in the application.

Given a small application without too many states, managing UI elements in the activity life cycle methods is fine. If the application grows and can change states based on processes outside the main thread, the number of places where changes are being made increases. This makes the application less maintainable (having state changing code in many places). I seek a design pattern that makes it more clear what happens to the UI in the various states.

I realize that persistence tools such as SQLiteDatabase andSharedPreferences are available, which might be part of the design pattern, but central control, where the state of the app can be maintained, along with control over what the user sees and what the user is able to do is the goal.

Aucun commentaire:

Enregistrer un commentaire