Search code examples
androidandroid-contentprovider

android: questions about ContentProvider


As I understand it, ContentProvider - is the data on the global level of the whole device?

The questions:

1) Is it possible to develop and distribute only ContentProvider (no Activity, ie not as a complete application, but only as data)? Does anybody do so? And when? As for the user it will look like? What is the difference between build of ContentProvider and build of normal application?

2) If another developer wants to use my ContentProvider, then how he will be able to access the column names and other data necessary to work with my ContentProvider? I have to give the library?

Sorry for my English.

Thanks


Solution

  • 1) Is it possible to develop and distribute only ContentProvider (no Activity,...

    You have to add at least one Activity to your App to be launched by user.In fact forsecurityreason all services,receivers,... that you declare in manifest,will not register unless your App run explicitly by user and this needs to a Main/Launcher Activity.So you have to add such Activity to your App.

    2) If another developer wants to use my ContentProvider,...

    You have to publish documentation in about your App.