Content providers
Building a content provider is a really smart thing to do. The content provider API comes with an interesting feature that allows applications to observe changes in a data set.
Content providers connect data in one process with code running in another process, even between two completely different applications if you want. If you ever wrote code to pick an image from the Gallery app, you may have experienced this behavior. Some component manipulates the persistent dataset that other components depend upon. A content provider can use many different ways to store data, which can be stored in a database, in files, or even over a network.
Datasets are identified by unique URIs, so it is possible to ask for notifications if a certain URI is changed. Here is where the observer pattern comes in.
The observer pattern is a common software design pattern in which an object (the subject) has one or more dependents (the observers, also known as the listeners) that will automatically be...