6. Content Providers

This chapter builds upon the brief introduction to content providers presented in Chapter 5, “Working with Databases in Android.” It discusses how to use a content provider to share data between internal parts of an app as well as with external apps. This chapter also discusses when it is appropriate to use a content provider, and it provides the code for a simple content provider implementation.

REST-Like APIs in Android

Content providers allow an app to expose structured data to other components of the same app and/or other apps. They also present an API similar to Representational State Transfer (REST) for accessing the data. Since the data in a content provider is usually retrieved using a URI, they also present a REST-like ...

Get Android™ Database Best Practices now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.