Safari Books Online is a digital library providing on-demand subscription access to thousands of learning resources.
A content provider in Android shares data between applications. Each application usually runs in its own process. By default, applications can’t access the data and files of other applications. We explained earlier that you can make preferences and files available across application boundaries with the correct permissions and if each application knows the context and path. This solution applies only to related applications that already know details about one another. In contrast, with a content provider you can publish and expose a particular data type for other applications to query, add, update, and delete, and those applications don’t need to have any prior knowledge of paths, resources, or who provides the content.
The canonical content provider in Android is the contacts list, which provides names, addresses, and phone numbers. You can access this data from any application by using the correct URI and a series of methods provided by the Activity and ContentResolver classes to retrieve and store data. You’ll learn more about ContentResolver as we explore provider details. One other data-related concept that a content provider offers is the Cursor, the same object we used previously to process SQLite database result sets.