If an app wants to allow its data to be available to other apps on the devices, it needs a way to control access. Content providers can be used as a public endpoint to the data, but they allow the app to maintain control over the data.
Creating content providers allows us to share data with other apps in a uniform manner. It is, for the most part, straightforward. Let's take a look at the following steps:
First, we inherit from the
ContentProvider
base type:public class NumberStringsContentProvider : ContentProvider { public override bool OnCreate () { } public override string GetType (Uri uri) { } public override ICursor Query ( Uri uri, string[] projection, string selection, string[] selectionArgs, string sortOrder) { } public override int Delete ( Uri uri, string selection, string[] selectionArgs) { } public override Uri Insert ( Uri uri, ContentValues values) { } public override int Update ( Uri uri...