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: