Content Providers - Consuming data from a Content Provider using Content Resolver
Content Providers are used to share data between applications When is it necessary to implement Content Provider? When we have to expose our apps data with other app Need some complex data copy functionality from our app We intend to use : Cursor Loader Cursor Adapter AbstractThreadedSyncAdapter What kind of data can Content Provider Expose? Data from Database FIle Data(JSON, XML, Audio, Video, Photos) Networked Data - AbstractThreadedSyncAdapter How to implement Content Provider? We need to make sure we have primary keys defined in our tables else Content Providers will not work properly Implement Custom ContentProvider class Define proper Content URIs for data to be exposed Content URI? Is an important concept to access any data from a ContentProvider. Assuming we are sharing data from database : Content URI has 3 components : Content : content:// Authority : Package Name of the App Path : User Defined String Constants Suppose App2 needs some data from App1 App2 will use a...