How to read contacts with Xamarin.Mobile for cross-platform apps

2k Views Asked by At

I'm doing some evaluation of programs and frameworks to build cross-platform apps.

Now, i am just trying to load the contacts of the device with Xamarin.Mobile.

I found this guide: http://components.xamarin.com/view/xamarin.mobile but when I enter var book = new Xamarin.Contacts.AddressBook(); Visual Studio shows the error:

'Xamarin.Contacts.AddressBook' does not contain a constructor that takes 0 arguments

All other recipes or guides I found on the Xamarin website are specific for Android or iOS.

Does anyone knows how can I read the contacts with Xamarin.Mobile cross-platform? Or maybe someone knows my mistake?

Thanks

1

There are 1 best solutions below

0
On

The suggestion above just didn't have enough context:

You can take a look of an example here : https://github.com/jamesmontemagno/Xamarin.Plugins/tree/master/Contacts, which an abstraction on top of Xamarin.Mobile to enable you to access the contacts from shared code. It is still in alpha, but work looking at and is available on NuGet.

Else you could use a shared project instead of a PCL and access Xamarin.Mobile.