Chapter 8. Composing Patterns
We have seen how patterns can be used to manipulate, organize, and present data, but this data has been fleeting, and we have not yet considered how to ensure data persists from one session to the next. In this chapter, we will look at how this is done using internal data storage mechanisms. In particular, we will explore how users can save their preferences, making the app simpler and more fun to use. Before we do this, we will begin the chapter by examining the composite pattern and its uses, particularly when it comes to constructing hierarchical structures such as Android UIs.
In this chapter, you will learn how to do the following:
Construct a composite pattern
Create a layout with composer
Use static files
Edit application files
Store user preferences
Understand the activity life cycle
Add unique identifiers
One of the most immediate ways we can apply design patterns to an Android project is layout inflation, and back in Chapter 6, Activating Patterns, we used...