The most common way for apps to share structured data is to use content providers. These providers present data in a table-like form for easy consumption.
If we are targeting an Android version earlier than 3.0, we will need to add the Xamarin Android Support v4 NuGet package.
Content providers give us a way to access data from other apps and services on the device. Here, we will view the contacts through an Android content provider. Let's take a look at the following steps:
As we are going to access the contacts, we have to request permission to do so:
[assembly: UsesPermission( Manifest.Permission.ReadContacts)]
Now that we have the permission, we will need a URI that directs us to the contact content provider:
string uri = ContactsContract.Contacts.ContentUri;
Next, we will request the contact ID and the display name using the column constants. There are several columns that can be selected, and we can request any combination of them...