T. Ne
T. Ne

Reputation: 21

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

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

Upvotes: 2

Views: 2027

Answers (1)

JamesMontemagno
JamesMontemagno

Reputation: 3792

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.

Upvotes: 2

Related Questions